From: michaelbirnstiehl Date: Mon, 7 Jun 2021 18:29:13 +0000 (-0500) Subject: SONAR-14895 Add dot net example to Bitbucket Pipelines documentation X-Git-Tag: 9.0.0.45539~129 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f6e85467d1fbf00236dfd242cbcbcedc5e03de63;p=sonarqube.git SONAR-14895 Add dot net example to Bitbucket Pipelines documentation --- diff --git a/server/sonar-docs/src/pages/analysis/bitbucket-cloud-integration.md b/server/sonar-docs/src/pages/analysis/bitbucket-cloud-integration.md index 6fb8dbe3aae..a118300108f 100644 --- a/server/sonar-docs/src/pages/analysis/bitbucket-cloud-integration.md +++ b/server/sonar-docs/src/pages/analysis/bitbucket-cloud-integration.md @@ -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 |