From 7d183fba62c01390bc829d76e040b5c293ff313a Mon Sep 17 00:00:00 2001 From: gounthar Date: Wed, 27 Nov 2024 13:54:35 +0100 Subject: [PATCH 1/5] chore(updatecli): Uses the native temurin source. --- updatecli/updatecli.d/jdk17.yaml | 66 ++++++++++++-------------------- 1 file changed, 25 insertions(+), 41 deletions(-) diff --git a/updatecli/updatecli.d/jdk17.yaml b/updatecli/updatecli.d/jdk17.yaml index 94a7768b..0e5e132b 100644 --- a/updatecli/updatecli.d/jdk17.yaml +++ b/updatecli/updatecli.d/jdk17.yaml @@ -15,59 +15,36 @@ scms: sources: jdk17LastVersion: - kind: githubrelease + kind: temurin name: Get the latest Adoptium JDK17 version spec: - owner: "adoptium" - repository: "temurin17-binaries" - token: "{{ requiredEnv .github.token }}" - username: "{{ .github.username }}" - versionfilter: - kind: regex - # jdk-17.0.2+8(https://github.com/adoptium/temurin17-binaries/releases/tag/jdk-17.0.2%2B8) is OK - # jdk-17.0.4.1+1(https://github.com/adoptium/temurin17-binaries/releases/tag/jdk-17.0.4.1%2B1) is OK - pattern: {{ .temurin.version_pattern }} + featureversion: 17 transformers: - trimprefix: "jdk-" - - replacer: - from: + - to: _ conditions: - checkTemurinJDK17AlpineDockerImage: - kind: dockerimage - name: Check if the container image "eclipse-temurin:-jdk-alpine" is available - transformers: - - addsuffix: "-jdk-alpine" + checkTemurinAllReleases: + name: Check if the "" is available for all platforms + kind: temurin spec: - architecture: linux/amd64 - image: eclipse-temurin - checkTemurinJDK17DebianDockerImages: - kind: dockerimage - name: Check if the container image "eclipse-temurin:-jdk-focal" is available - transformers: - - addsuffix: "-jdk-focal" - spec: - architectures: - - linux/amd64 - - linux/arm64 + featureversion: 17 + platforms: + - alpine-linux/x64 + - linux/x64 + - linux/aarch64 + - linux/ppc64le - linux/s390x - - linux/arm/v7 - image: eclipse-temurin - checkTemurinJDK17WindowsCoreDockerImage: - kind: dockerimage - name: Check if the container image "eclipse-temurin:-jdk-windowsservercore-1809" is available - transformers: - - addsuffix: "-jdk-windowsservercore-1809" - spec: - architecture: windows/amd64 - image: eclipse-temurin + - linux/arm + - windows/x64 targets: setJDK17VersionDockerBake: name: "Bump JDK17 version for Linux images in the docker-bake.hcl file" kind: hcl - sourceid: jdk17LastVersion + transformers: + - replacer: + from: "+" + to: "_" spec: file: docker-bake.hcl path: variable.JAVA17_VERSION.default @@ -75,7 +52,10 @@ targets: setJDK17VersionAlpine: name: "Bump JDK17 default ARG version on Alpine Dockerfile" kind: dockerfile - sourceid: jdk17LastVersion + transformers: + - replacer: + from: "+" + to: "_" spec: file: alpine/Dockerfile instruction: @@ -85,6 +65,10 @@ targets: setJDK17VersionDebian: name: "Bump JDK17 default ARG version on Debian Dockerfile" kind: dockerfile + transformers: + - replacer: + from: "+" + to: "_" sourceid: jdk17LastVersion spec: file: debian/Dockerfile From 188409751d624da1755f21cb08aac57818c3ea0e Mon Sep 17 00:00:00 2001 From: gounthar Date: Wed, 27 Nov 2024 14:55:04 +0100 Subject: [PATCH 2/5] chore(updatecli): Uses the native temurin source. --- updatecli/scripts/check-jdk.sh | 52 ------------------------------ updatecli/updatecli.d/jdk21.yaml | 54 +++++++++++--------------------- 2 files changed, 18 insertions(+), 88 deletions(-) delete mode 100755 updatecli/scripts/check-jdk.sh diff --git a/updatecli/scripts/check-jdk.sh b/updatecli/scripts/check-jdk.sh deleted file mode 100755 index cb1b4dbc..00000000 --- a/updatecli/scripts/check-jdk.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/bash -# This script checks that the provided JDK version has all the required binaries available for downloads -# as sometimes, the tag for adoptium is published immeidatly while binaries are published later. -## -# The source of truth is the ERB template stored at the location dist/profile/templates/jenkinscontroller/casc/tools.yaml.erb -# It lists all the installations used as "Jenkins Tools" by the Jenkins controllers of the infrastructure -## -set -eu -o pipefail - -command -v curl >/dev/null 2>&1 || { echo "ERROR: curl command not found. Exiting."; exit 1; } - -function get_jdk_download_url() { - jdk_version="${1}" - platform="${2}" - case "${jdk_version}" in - 17*) - ## JDK17 URLs have an underscore ('_') instead of a plus ('+') in their archive names - echo "https://github.com/adoptium/temurin17-binaries/releases/download/jdk-${jdk_version}/OpenJDK17U-jdk_${platform}_hotspot_${jdk_version//+/_}"; - return 0;; - 21*) - ## JDK21 URLs have an underscore ('_') instead of a plus ('+') in their archive names - echo "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-${jdk_version}/OpenJDK21U-jdk_${platform}_hotspot_${jdk_version//+/_}"; - return 0;; - *) - echo "ERROR: unsupported JDK version (${jdk_version})."; - exit 1;; - esac -} - -case "${1}" in - 17.*+*) - platforms=("x64_linux" "x64_windows" "aarch64_linux" "s390x_linux");; - 21*+*) - platforms=("x64_linux" "x64_windows" "aarch64_linux");; - *) - echo "ERROR: unsupported JDK version (${1})."; - exit 1;; -esac - -for platform in "${platforms[@]}" -do - url_to_check="$(get_jdk_download_url "${1}" "${platform}")" - if [[ "${platform}" == *windows* ]] - then - url_to_check+=".zip" - else - url_to_check+=".tar.gz" - fi - >&2 curl --connect-timeout 5 --location --head --fail --silent "${url_to_check}" || { echo "ERROR: the following URL is NOT available: ${url_to_check}."; exit 1; } -done - -echo "OK: all JDK URL for version=${1} are available." diff --git a/updatecli/updatecli.d/jdk21.yaml b/updatecli/updatecli.d/jdk21.yaml index 70becbff..2da65642 100644 --- a/updatecli/updatecli.d/jdk21.yaml +++ b/updatecli/updatecli.d/jdk21.yaml @@ -24,55 +24,37 @@ scms: sources: jdk21LastVersion: - name: Get the latest Adoptium JDK21 version - kind: gittag - scmid: temurin21-binaries + kind: temurin + name: Get the latest Adoptium JDK21 version via the API spec: - versionfilter: - kind: regex - pattern: '{{ .temurin.version_pattern }}' + featureversion: 21 transformers: - trimprefix: "jdk-" - - replacer: - from: "+" - to: "_" conditions: - checkTemurinJDK21AlpineDockerImage: - kind: dockerimage - name: Check if the container image "eclipse-temurin:-jdk-alpine" is available - transformers: - - addsuffix: "-jdk-alpine" - spec: - architectures: - - linux/amd64 - - linux/arm64 - image: eclipse-temurin - checkTemurinJDK21DebianDockerImages: - kind: dockerimage - name: Check if the container image "eclipse-temurin:-jdk-jammy" is available - transformers: - - addsuffix: "-jdk-jammy" + checkTemurinAllReleases: + name: Check if the "" is available for all platforms + kind: temurin spec: - architectures: - - linux/amd64 - - linux/arm64 + featureversion: 21 + platforms: + - alpine-linux/x64 + - alpine-linux/aarch64 + - linux/x64 + - linux/aarch64 + - linux/ppc64le - linux/s390x - image: eclipse-temurin - checkTemurinJDK21WindowsCoreDockerImage: - kind: dockerimage - name: Check if the container image "eclipse-temurin:-jdk-windowsservercore-1809" is available - transformers: - - addsuffix: "-jdk-windowsservercore-1809" - spec: - architecture: windows/amd64 - image: eclipse-temurin + - windows/x64 targets: setJDK21VersionDockerBake: name: "Bump JDK21 version for Linux images in the docker-bake.hcl file" kind: hcl sourceid: jdk21LastVersion + transformers: + - replacer: + from: "+" + to: "_" spec: file: docker-bake.hcl path: variable.JAVA21_VERSION.default From 3de9b187449ccaf857ae42ac38b68d803c8109a2 Mon Sep 17 00:00:00 2001 From: gounthar Date: Wed, 27 Nov 2024 14:58:42 +0100 Subject: [PATCH 3/5] chore(ga): Bumps the updatecli action to benefit from the temurin source. --- .github/workflows/updatecli.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/updatecli.yaml b/.github/workflows/updatecli.yaml index 8e605d43..e218a3b8 100644 --- a/.github/workflows/updatecli.yaml +++ b/.github/workflows/updatecli.yaml @@ -15,7 +15,7 @@ jobs: uses: actions/checkout@v4 - name: Install Updatecli in the runner - uses: updatecli/updatecli-action@v2.70.0 + uses: updatecli/updatecli-action@v2.71.0 - name: Run Updatecli in Dry Run mode run: updatecli diff --config ./updatecli/updatecli.d --values ./updatecli/values.github-action.yaml --values ./updatecli/values.temurin.yaml From 3d64ed697ee14bc74127dd91eefade96ebcf1193 Mon Sep 17 00:00:00 2001 From: gounthar Date: Wed, 27 Nov 2024 15:13:16 +0100 Subject: [PATCH 4/5] fix(updatecli): Standardize sourceid usage across targets. --- updatecli/updatecli.d/jdk17.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/updatecli/updatecli.d/jdk17.yaml b/updatecli/updatecli.d/jdk17.yaml index 0e5e132b..2712bc11 100644 --- a/updatecli/updatecli.d/jdk17.yaml +++ b/updatecli/updatecli.d/jdk17.yaml @@ -69,7 +69,6 @@ targets: - replacer: from: "+" to: "_" - sourceid: jdk17LastVersion spec: file: debian/Dockerfile instruction: From a6533e45e3a3820f7b5b7061ae4f4abac50574e5 Mon Sep 17 00:00:00 2001 From: Bruno Verachten Date: Wed, 27 Nov 2024 17:36:55 +0100 Subject: [PATCH 5/5] Update updatecli/updatecli.d/jdk21.yaml Co-authored-by: lemeurherveCB <137290663+lemeurherveCB@users.noreply.github.com> --- updatecli/updatecli.d/jdk21.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/updatecli/updatecli.d/jdk21.yaml b/updatecli/updatecli.d/jdk21.yaml index 2da65642..50a0e828 100644 --- a/updatecli/updatecli.d/jdk21.yaml +++ b/updatecli/updatecli.d/jdk21.yaml @@ -25,7 +25,7 @@ scms: sources: jdk21LastVersion: kind: temurin - name: Get the latest Adoptium JDK21 version via the API + name: Get the latest Adoptium JDK21 version spec: featureversion: 21 transformers: