From f3a7352d5df506c6cf1d93afb5c179651b1b79aa Mon Sep 17 00:00:00 2001 From: Wouter Admiraal Date: Wed, 5 Jan 2022 15:11:06 +0100 Subject: [PATCH] SONAR-15833 Fix C/C++ tutorial for Bitbucket Pipelines --- .../AnalysisCommand-test.tsx.snap | 26 ++++++++++--------- .../bitbucket-pipelines/commands/CFamily.ts | 13 +++++----- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/__tests__/__snapshots__/AnalysisCommand-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/__tests__/__snapshots__/AnalysisCommand-test.tsx.snap index 697363c2ecc..6a24055c89b 100644 --- a/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/__tests__/__snapshots__/AnalysisCommand-test.tsx.snap +++ b/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/__tests__/__snapshots__/AnalysisCommand-test.tsx.snap @@ -34,17 +34,18 @@ exports[`should render correctly for cfamily 1`] = ` definitions: steps: - step: &build-step - name: Download and install the build wrapper, build the project + name: Build the project, and run the SonarQube analysis script: + - export SONAR_SCANNER_VERSION=4.6.2.2472 - mkdir $HOME/.sonar - curl -sSLo $HOME/.sonar/build-wrapper-linux-x86.zip \${SONAR_HOST_URL}/static/cpp/build-wrapper-linux-x86.zip - unzip -o $HOME/.sonar/build-wrapper-linux-x86.zip -d $HOME/.sonar/ + - curl -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-\${SONAR_SCANNER_VERSION}-linux.zip + - unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/ + - export PATH=\\"$PATH:$HOME/.sonar/sonar-scanner-\${SONAR_SCANNER_VERSION}-linux/bin\\" + - - $HOME/.sonar/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir bw-output - - pipe: sonarsource/sonarqube-scan:1.0.0 - variables: - EXTRA_ARGS: -Dsonar.cfamily.build-wrapper-output=bw-output - SONAR_HOST_URL: \${SONAR_HOST_URL} - SONAR_TOKEN: \${SONAR_TOKEN} + - sonar-scanner -Dsonar.cfamily.build-wrapper-output=bw-output caches: sonar: ~/.sonar @@ -97,17 +98,18 @@ exports[`should render correctly for cfamily: with branch enabled 1`] = ` definitions: steps: - step: &build-step - name: Download and install the build wrapper, build the project + name: Build the project, and run the SonarQube analysis script: + - export SONAR_SCANNER_VERSION=4.6.2.2472 - mkdir $HOME/.sonar - curl -sSLo $HOME/.sonar/build-wrapper-linux-x86.zip \${SONAR_HOST_URL}/static/cpp/build-wrapper-linux-x86.zip - unzip -o $HOME/.sonar/build-wrapper-linux-x86.zip -d $HOME/.sonar/ + - curl -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-\${SONAR_SCANNER_VERSION}-linux.zip + - unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/ + - export PATH=\\"$PATH:$HOME/.sonar/sonar-scanner-\${SONAR_SCANNER_VERSION}-linux/bin\\" + - - $HOME/.sonar/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir bw-output - - pipe: sonarsource/sonarqube-scan:1.0.0 - variables: - EXTRA_ARGS: -Dsonar.cfamily.build-wrapper-output=bw-output - SONAR_HOST_URL: \${SONAR_HOST_URL} - SONAR_TOKEN: \${SONAR_TOKEN} + - sonar-scanner -Dsonar.cfamily.build-wrapper-output=bw-output caches: sonar: ~/.sonar diff --git a/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/commands/CFamily.ts b/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/commands/CFamily.ts index 3aa24a50cb3..75f34dd76a1 100644 --- a/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/commands/CFamily.ts +++ b/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/commands/CFamily.ts @@ -24,17 +24,18 @@ export default function cFamilyExample(branchesEnabled: boolean) { definitions: steps: - step: &build-step - name: Download and install the build wrapper, build the project + name: Build the project, and run the SonarQube analysis script: + - export SONAR_SCANNER_VERSION=4.6.2.2472 - mkdir $HOME/.sonar - curl -sSLo $HOME/.sonar/build-wrapper-linux-x86.zip \${SONAR_HOST_URL}/static/cpp/build-wrapper-linux-x86.zip - unzip -o $HOME/.sonar/build-wrapper-linux-x86.zip -d $HOME/.sonar/ + - curl -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-\${SONAR_SCANNER_VERSION}-linux.zip + - unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/ + - export PATH="$PATH:$HOME/.sonar/sonar-scanner-\${SONAR_SCANNER_VERSION}-linux/bin" + - - $HOME/.sonar/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir bw-output - - pipe: sonarsource/sonarqube-scan:1.0.0 - variables: - EXTRA_ARGS: -Dsonar.cfamily.build-wrapper-output=bw-output - SONAR_HOST_URL: \${SONAR_HOST_URL} - SONAR_TOKEN: \${SONAR_TOKEN} + - sonar-scanner -Dsonar.cfamily.build-wrapper-output=bw-output caches: sonar: ~/.sonar -- 2.39.5