diff --git a/goss/goss.yaml b/goss/goss.yaml index 1e32cbcf6..f5a936673 100644 --- a/goss/goss.yaml +++ b/goss/goss.yaml @@ -19,6 +19,11 @@ command: stdout: - 19.0.2+7 stderr: [] + /opt/jdk-21/bin/java --version: + exit-status: 0 + stdout: + - 21-beta 2023-09-19 + stderr: [] file: /home/jenkins: exists: true diff --git a/provisioning/tools-versions.yml b/provisioning/tools-versions.yml index 58fa1c129..5822cff30 100644 --- a/provisioning/tools-versions.yml +++ b/provisioning/tools-versions.yml @@ -15,6 +15,7 @@ hadolint_version: 2.12.0 jdk11_version: 11.0.20+8 jdk17_version: 17.0.8+7 jdk19_version: 19.0.2+7 +jdk21_version: 2023-08-09-06-56-beta jdk8_version: 8u382-b05 jenkins_remoting_version: 3142.vcfca_0cd92128 jq_version: 1.6 diff --git a/provisioning/ubuntu-provision.sh b/provisioning/ubuntu-provision.sh index b4bf22531..b4c32561b 100755 --- a/provisioning/ubuntu-provision.sh +++ b/provisioning/ubuntu-provision.sh @@ -286,7 +286,9 @@ function install_jdk() { apt-get install --yes --no-install-recommends fontconfig ## OpenJDKs: Adoptium - https://adoptium.net/installation.html - mkdir -p /opt/jdk-8 /opt/jdk-11 /opt/jdk-17 /opt/jdk-19 + for jdkVersion in 8 11 17 19 21; do + mkdir -p "/opt/jdk-$jdkVersion" + done # JDK8 jdk8_short_version="${JDK8_VERSION//-/}" @@ -318,6 +320,12 @@ function install_jdk() { "https://github.com/adoptium/temurin19-binaries/releases/download/jdk-${JDK19_VERSION}/OpenJDK19U-jdk_${cpu_arch_short}_linux_hotspot_${jdk19_short_version}.tar.gz" tar --extract --gunzip --file=/tmp/jdk19.tgz --directory=/opt/jdk-19 --strip-components=1 + # JDK21 https://github.com/adoptium/temurin21-binaries/releases/download/jdk21-2023-08-09-06-56-beta/OpenJDK21U-jdk_aarch64_linux_hotspot_2023-08-09-06-56.tar.gz + jdk21_short_version="${JDK21_VERSION//-beta/}" + curl -sSL -o /tmp/jdk21.tgz \ + "https://github.com/adoptium/temurin21-binaries/releases/download/jdk21-${JDK21_VERSION}/OpenJDK21U-jdk_${cpu_arch_short}_linux_hotspot_${jdk21_short_version}.tar.gz" + tar --extract --gunzip --file=/tmp/jdk21.tgz --directory=/opt/jdk-21 --strip-components=1 + # Define JDK installations # The priority of a JDK is the last argument. # Starts by setting priority to the JDK major version: higher version is the expected default @@ -325,6 +333,7 @@ function install_jdk() { update-alternatives --install /usr/bin/java java /opt/jdk-11/bin/java 11 update-alternatives --install /usr/bin/java java /opt/jdk-17/bin/java 17 update-alternatives --install /usr/bin/java java /opt/jdk-19/bin/java 19 + update-alternatives --install /usr/bin/java java /opt/jdk-21/bin/java 21 # Then, use the DEFAULT_JDK env var to set the priority of the specified default JDK to 1000 to ensure its the one used by update-alternatives update-alternatives --install /usr/bin/java java "/opt/jdk-${DEFAULT_JDK}/bin/java" 1000 echo "JAVA_HOME=/opt/jdk-${DEFAULT_JDK}" >> /etc/environment diff --git a/provisioning/windows-provision.ps1 b/provisioning/windows-provision.ps1 index 34507c29e..c93a28d4c 100644 --- a/provisioning/windows-provision.ps1 +++ b/provisioning/windows-provision.ps1 @@ -123,6 +123,19 @@ $downloads = [ordered]@{ & "$baseDir\jdk-19\bin\java.exe" -version; } }; + 'jdk21' = @{ + 'url' = 'https://github.com/adoptium/temurin21-binaries/releases/download/jdk21-{0}/OpenJDK21U-jdk_x64_windows_hotspot_{1}.zip' -f [System.Web.HTTPUtility]::UrlEncode($env:JDK21_VERSION),$env:JDK21_VERSION.Replace('-beta', ''); + 'local' = "$baseDir\temurin21.zip"; + 'expandTo' = $baseDir; + 'postExpand' = { + & Move-Item -Path "$baseDir\jdk-21*" -Destination "$baseDir\jdk-21" + }; + 'cleanupLocal' = 'true'; + # folder included here since it's not in the PATH + 'sanityCheck'= { + & "$baseDir\jdk-21\bin\java.exe" -version; + } + }; 'jdk8' = @{ 'url' = 'https://github.com/adoptium/temurin8-binaries/releases/download/jdk{0}/OpenJDK8U-jdk_x64_windows_hotspot_{1}.zip' -f $env:JDK8_VERSION,$env:JDK8_VERSION.Replace('-', ''); 'local' = "$baseDir\temurin8.zip";