From: Aric Gardner Date: Mon, 14 Sep 2020 20:47:42 +0000 (-0400) Subject: Use java11 for sonar cloud upload X-Git-Tag: v0.57.4~6 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=c4ab45e68f3d6b15ef604e4a0c8930d3da4e6bc8;p=releng%2Fglobal-jjb.git Use java11 for sonar cloud upload default to openjdk11 before calling sonarcloud upload. sonar cloud upload will stop working with java8 on october 1st Signed-off-by: Aric Gardner Change-Id: I8c321b053a86e1f15149552af25b775353051444 --- diff --git a/releasenotes/notes/cmake-sonar-aaff1701b8ccdfa0.yaml b/releasenotes/notes/cmake-sonar-aaff1701b8ccdfa0.yaml new file mode 100644 index 00000000..ab06027c --- /dev/null +++ b/releasenotes/notes/cmake-sonar-aaff1701b8ccdfa0.yaml @@ -0,0 +1,5 @@ +--- +deprecations: + - | + Cmake builds upload to SonarCloud. Fix build env to use openjdk11 + sonarcloud upload will stop working with java8 on October 1st 2020 diff --git a/shell/cmake-sonar.sh b/shell/cmake-sonar.sh index ccf17d57..e568a7a3 100644 --- a/shell/cmake-sonar.sh +++ b/shell/cmake-sonar.sh @@ -20,6 +20,12 @@ make_opts="${MAKE_OPTS:-}" set -ex -o pipefail +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) +# shellcheck disable=SC1091 +source /tmp/java.env + cd /tmp || exit 1 wget -q -O /tmp/sonar-scan.zip \ "https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip" diff --git a/shell/cmake-sonarqube.sh b/shell/cmake-sonarqube.sh index 0dd2cf55..1662e330 100644 --- a/shell/cmake-sonarqube.sh +++ b/shell/cmake-sonarqube.sh @@ -25,6 +25,13 @@ wget -q -O bw.zip https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip unzip -q bw.zip sudo mv build-wrapper-* /opt/build-wrapper + +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) +# shellcheck disable=SC1091 +source /tmp/java.env + mkdir -p "$build_dir" cd "$build_dir" || exit 1