Code Analysis
Running SonarQube by script
Run Sonar in container :
docker compose -f ./docker/sonar.yml up -d
Wait container was up Run
SonarAnalysis.ps1
and go to http://localhost:9001
Running SonarQube manually
Run Sonar in container :
docker compose -f ./docker/sonar.yml up -d
Install sonar scanner for .net :
dotnet tool install --global dotnet-sonarscanner
Run
dotnet sonarscanner begin /d:sonar.login=admin /d:sonar.password=admin /k:"YourProject" /d:sonar.host.url="http://localhost:9001" /s:"`pwd`/SonarQube.Analysis.xml"
Build your application :
dotnet build
Publish sonar results :
dotnet sonarscanner end /d:sonar.login=admin /d:sonar.password=admin
Go to http://localhost:9001