X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Fcmake-sonar.sh;h=0bbf559e69277d0fcb41f388cfa2dc322fc9b36c;hb=bafd57c92d85a6c8b2c3fd3dbe30aa3a09f8f620;hp=ccf17d57ba0227f0783b250ae4b0f216284d6cb8;hpb=d738640e1a59840d85430fcf1b925795f0e4c6bd;p=releng%2Fglobal-jjb.git diff --git a/shell/cmake-sonar.sh b/shell/cmake-sonar.sh index ccf17d57..0bbf559e 100644 --- a/shell/cmake-sonar.sh +++ b/shell/cmake-sonar.sh @@ -20,9 +20,20 @@ make_opts="${MAKE_OPTS:-}" set -ex -o pipefail +export SET_JDK_VERSION="${SET_JDK_VERSION:-openjdk11}" +echo "$SET_JDK_VERSION" +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 @@ -39,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}" \