diff options
author | michaelbirnstiehl <michael.birnstiehl@sonarsource.com> | 2021-06-07 13:29:13 -0500 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2021-06-09 20:03:05 +0000 |
commit | f6e85467d1fbf00236dfd242cbcbcedc5e03de63 (patch) | |
tree | 3f6a6100d3f1ea8503176f85f67004049d593bed /server/sonar-docs | |
parent | 9abccd975a7b7a750760b1f839fcfdbab0d2446d (diff) | |
download | sonarqube-f6e85467d1fbf00236dfd242cbcbcedc5e03de63.tar.gz sonarqube-f6e85467d1fbf00236dfd242cbcbcedc5e03de63.zip |
SONAR-14895 Add dot net example to Bitbucket Pipelines documentation
Diffstat (limited to 'server/sonar-docs')
-rw-r--r-- | server/sonar-docs/src/pages/analysis/bitbucket-cloud-integration.md | 43 |
1 files changed, 43 insertions, 0 deletions
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 @@ -176,6 +176,49 @@ Click the scanner you're using below to expand the example configuration: | ``` [[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 | | You can set up the SonarScanner CLI configuration the following ways: |