X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Fcmake-sonar.sh;h=0bbf559e69277d0fcb41f388cfa2dc322fc9b36c;hb=bafd57c92d85a6c8b2c3fd3dbe30aa3a09f8f620;hp=e64ca69cf83803f80640dcff040565ca9557b67d;hpb=5a6965f43f220bf6002bfde60897afd216f52ab0;p=releng%2Fglobal-jjb.git diff --git a/shell/cmake-sonar.sh b/shell/cmake-sonar.sh index e64ca69c..0bbf559e 100644 --- a/shell/cmake-sonar.sh +++ b/shell/cmake-sonar.sh @@ -22,13 +22,18 @@ set -ex -o pipefail export SET_JDK_VERSION="${SET_JDK_VERSION:-openjdk11}" echo "$SET_JDK_VERSION" -bash <(curl -s https://raw.githubusercontent.com/lfit/releng-global-jjb/master/shell/update-java-alternatives.sh) +GITHUB_RAW_BASE_URL="https://raw.githubusercontent.com" +GITHUB_FILE="lfit/releng-global-jjb/master/shell/update-java-alternatives.sh" +bash <(curl -s "${GITHUB_RAW_BASE_URL}/${GITHUB_FILE}") # shellcheck disable=SC1091 source /tmp/java.env cd /tmp || exit 1 +SONAR_BASE_URL="https://binaries.sonarsource.com" +SONAR_SCANER_PATH="Distribution/sonar-scanner-cli" +SONAR_SCANER_CLI="sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip" wget -q -O /tmp/sonar-scan.zip \ - "https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip" + "${SONAR_BASE_URL}/${SONAR_SCANER_PATH}/${SONAR_SCANER_CLI}" unzip -q sonar-scan.zip sudo mv sonar-scanner-* /opt/sonar-scanner @@ -45,8 +50,8 @@ eval cmake -DCMAKE_INSTALL_PREFIX="$INSTALL_PREFIX" $cmake_opts .. # $make_opts may be empty. # shellcheck disable=SC2086 -/opt/build-wrapper/build-wrapper-linux-x86-64 --out-dir "$WORKSPACE/bw-output" \ - make $make_opts +/opt/build-wrapper/build-wrapper-linux-x86-64 --out-dir \ + "$WORKSPACE/bw-output" make $make_opts /opt/sonar-scanner/bin/sonar-scanner \ -Dsonar.projectKey="${PROJECT_KEY}" \