]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-14895 Add dot net example to Bitbucket Pipelines documentation
authormichaelbirnstiehl <michael.birnstiehl@sonarsource.com>
Mon, 7 Jun 2021 18:29:13 +0000 (13:29 -0500)
committersonartech <sonartech@sonarsource.com>
Wed, 9 Jun 2021 20:03:05 +0000 (20:03 +0000)
server/sonar-docs/src/pages/analysis/bitbucket-cloud-integration.md

index 6fb8dbe3aae8d9163db9d057f3510b92a64f2231..a118300108f3824b0c0548a895d8be9bcc5862fe 100644 (file)
@@ -175,6 +175,49 @@ Click the scanner you're using below to expand the example configuration:
 |     sonar: ~/.sonar
 | ```
 
+[[collapse]]
+| ## SonarScanner for .NET
+|
+| Write the following in your `bitbucket-pipelines.yml`:
+| 
+| ```
+| image: mcr.microsoft.com/dotnet/core/sdk:latest
+| pipelines:
+|   branches:
+|     '{master}':
+|       - step:
+|           name: SonarQube analysis
+|           caches:
+|             - dotnetcore
+|             - sonar
+|           script:
+|             - apt-get update
+|             - apt-get install --yes openjdk-11-jre
+|             - dotnet tool install --global dotnet-sonarscanner
+|             - export PATH="$PATH:/root/.dotnet/tools"
+|             - dotnet sonarscanner begin /k:"*YOUR PROJECT KEY*" /d:"sonar.login=${SONAR_TOKEN}"  /d:"sonar.host.url=${SONAR_HOST_URL}"
+|             - dotnet build 
+|             - dotnet sonarscanner end /d:"sonar.login=${SONAR_TOKEN}"
+|   pull-requests:
+|     '**':
+|       - step:
+|           name: SonarQube analysis
+|           caches:
+|             - dotnetcore
+|             - sonar
+|           script:
+|             - apt-get update
+|             - apt-get install --yes openjdk-11-jre
+|             - dotnet tool install --global dotnet-sonarscanner
+|             - export PATH="$PATH:/root/.dotnet/tools"
+|             - dotnet sonarscanner begin /k:"*YOUR PROJECT KEY*" /d:"sonar.login=${SONAR_TOKEN}"  /d:"sonar.host.url=${SONAR_HOST_URL}"
+|             - dotnet build 
+|             - dotnet sonarscanner end /d:"sonar.login=${SONAR_TOKEN}"
+| definitions:
+|   caches:
+|     sonar: ~/.sonar
+|```
+
 [[collapse]]
 | ## SonarScanner CLI
 |