X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Fcmake-sonar.sh;h=ccf17d57ba0227f0783b250ae4b0f216284d6cb8;hb=cfe6494e335f277155582ba564bdceae1ee043fd;hp=cd7ee71561cba183b54ede71ab6f40f60c0d28fc;hpb=2b811ee74f223040ff6071969566de72aed71b2a;p=releng%2Fglobal-jjb.git diff --git a/shell/cmake-sonar.sh b/shell/cmake-sonar.sh index cd7ee715..ccf17d57 100644 --- a/shell/cmake-sonar.sh +++ b/shell/cmake-sonar.sh @@ -21,14 +21,14 @@ make_opts="${MAKE_OPTS:-}" set -ex -o pipefail cd /tmp || exit 1 -wget -O /tmp/sonar-scan.zip \ +wget -q -O /tmp/sonar-scan.zip \ "https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip" -unzip sonar-scan.zip +unzip -q sonar-scan.zip sudo mv sonar-scanner-* /opt/sonar-scanner -wget -O /tmp/bw.zip \ +wget -q -O /tmp/bw.zip \ "https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip" -unzip bw.zip +unzip -q bw.zip sudo mv build-wrapper-* /opt/build-wrapper mkdir -p "$build_dir" @@ -37,13 +37,15 @@ cd "$build_dir" || exit 1 # shellcheck disable=SC2086 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/sonar-scanner/bin/sonar-scanner \ - -Dsonar.projectKey=${PROJECT_KEY} \ - -Dsonar.organization=${PROJECT_ORGANIZATION} \ + -Dsonar.projectKey="${PROJECT_KEY}" \ + -Dsonar.organization="${PROJECT_ORGANIZATION}" \ -Dsonar.sources=. \ -Dsonar.cfamily.build-wrapper-output="$WORKSPACE/bw-output" \ - -Dsonar.host.url=${SONAR_HOST_URL} \ - -Dsonar.login=${API_TOKEN} + -Dsonar.host.url="${SONAR_HOST_URL}" \ + -Dsonar.login="${API_TOKEN}"