Use java11 for sonar cloud upload 83/65483/6
authorAric Gardner <agardner@linuxfoundation.org>
Mon, 14 Sep 2020 20:47:42 +0000 (16:47 -0400)
committerAric Gardner <agardner@linuxfoundation.org>
Tue, 15 Sep 2020 23:07:50 +0000 (19:07 -0400)
default to openjdk11
before calling sonarcloud upload.

sonar cloud upload will stop working
with java8 on october 1st

Signed-off-by: Aric Gardner <agardner@linuxfoundation.org>
Change-Id: I8c321b053a86e1f15149552af25b775353051444

releasenotes/notes/cmake-sonar-aaff1701b8ccdfa0.yaml [new file with mode: 0644]
shell/cmake-sonar.sh
shell/cmake-sonarqube.sh

diff --git a/releasenotes/notes/cmake-sonar-aaff1701b8ccdfa0.yaml b/releasenotes/notes/cmake-sonar-aaff1701b8ccdfa0.yaml
new file mode 100644 (file)
index 0000000..ab06027
--- /dev/null
@@ -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
index ccf17d5..e568a7a 100644 (file)
@@ -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"
index 0dd2cf5..1662e33 100644 (file)
@@ -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