Install JDK 11 for ONOS 2.2 builds and build tests
Change-Id: Ia8987715d8ef6595edd0a5a1af88d732bba76f2d
diff --git a/jjb/onos/install-jdk.sh b/jjb/onos/install-jdk.sh
new file mode 100644
index 0000000..bbca982
--- /dev/null
+++ b/jjb/onos/install-jdk.sh
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+# exit on errors
+set -eu -o pipefail
+
+if [ ${GERRIT_BRANCH} == "master" ]
+then
+ BAZEL_VERSION="0.19.2"
+else
+ if [ ${GERRIT_BRANCH} == "master" ]; then
+ BAZEL_VERSION="0.27.0"
+ else
+ BAZEL_VERSION="0.24.1"
+ fi
+fi
+
+if [ ${GERRIT_BRANCH} == "master" -o ${GERRIT_BRANCH} == "onos-2.2" ]
+then
+ echo Installing OPEN JDK 11
+ curl -L -o jdk.tar.gz -s https://cdn.azul.com/zulu/bin/zulu11.31.11-ca-jdk11.0.3-linux_x64.tar.gz
+ tar xf jdk.tar.gz
+ export JAVA_HOME="$HOME/zulu11.31.11-ca-jdk11.0.3-linux_x64"
+ PATH="$JAVA_HOME/bin:$PATH"
+ which java
+else
+ echo Using default JDK
+fi
+
+
diff --git a/jjb/onos/onos-verify.yaml b/jjb/onos/onos-verify.yaml
index af3cd83..9a7f90d 100644
--- a/jjb/onos/onos-verify.yaml
+++ b/jjb/onos/onos-verify.yaml
@@ -447,6 +447,7 @@
#put shell scripts in file then make sure shell check is installed on verify vms
- shell: !include-raw-escape: install-bazel.sh
+ - shell: !include-raw-escape: install-jdk.sh
- shell: !include-raw-escape: onos-release-build-verify.sh
# JJB 1.6.2 does not support parameter expansion on filename?
#- shell: !include-raw-escape: {project-name}-verify.sh
@@ -521,6 +522,7 @@
#put shell scripts in file then make sure shell check is installed on verify vms
- shell: !include-raw-escape: install-bazel.sh
+ - shell: !include-raw-escape: install-jdk.sh
- shell: !include-raw-escape: onos-bazel-release-build.sh
# JJB 1.6.2 does not support parameter expansion on filename?
#- shell: !include-raw-escape: {project-name}-verify.sh