-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
32 lines (24 loc) · 925 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# This Makefile is silent by default, use `make -s` to override
.SILENT:
# Phony targets to avoid file name conflict
.PHONY: help sonar
# Include environment variables from .env file
include .env
export $(shell sed 's/=.*//' .env)
# Display help information about this Makefile.
help:
@echo "Available targets:"
@echo " sonar: Run SonarQube analysis"
# Target for running SonarQube analysis
sonar:
# Echo a message
echo "Running SonarQube analysis"
# Begin SonarQube analysis
# If this command fails, the make command will stop
dotnet sonarscanner begin /k:"${SONAR_PROJECT_NAME}" /d:sonar.host.url="${SONAR_HOST_URL}" /d:sonar.login="${SONAR_LOGIN}" || exit 1
# Build the project
# If this command fails, the make command will stop
dotnet build || exit 1
# End SonarQube analysis
# If this command fails, the make command will stop
dotnet sonarscanner end /d:sonar.login="${SONAR_LOGIN}" || exit 1