diff --git a/updatecli/scripts/check-jdk.sh b/updatecli/scripts/check-jdk.sh deleted file mode 100644 index 0d5933c..0000000 --- a/updatecli/scripts/check-jdk.sh +++ /dev/null @@ -1,48 +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/buildmaster/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 - 8*) - ## JDK8 does not have the carret ('-') in their archive names - echo "https://github.com/adoptium/temurin8-binaries/releases/download/jdk${jdk_version}/OpenJDK8U-jdk_${platform}_hotspot_${jdk_version//-}"; - return 0;; - 11*) - ## JDK11 URLs have an underscore ('_') instead of a plus ('+') in their archive names - echo "https://github.com/adoptium/temurin11-binaries/releases/download/jdk-${jdk_version}/OpenJDK11U-jdk_${platform}_hotspot_${jdk_version//+/_}"; - return 0;; - 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;; - *) - echo "ERROR: unsupported JDK version (${jdk_version})."; - exit 1;; - esac -} - -platforms=("x64_linux" "x64_windows" "aarch64_linux") - -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/weekly.d/inboundimage.yml b/updatecli/updatecli.d/weekly.d/inboundimage.yml index 57aab5d..9d69c8f 100644 --- a/updatecli/updatecli.d/weekly.d/inboundimage.yml +++ b/updatecli/updatecli.d/weekly.d/inboundimage.yml @@ -19,7 +19,7 @@ sources: name: Get the latest jenkinsci:docker-inbound-agent spec: owner: "jenkinsci" - repository: "docker-inbound-agent" + repository: "docker-agent" token: "{{ requiredEnv .github.token }}" username: "{{ .github.username }}" versionfilter: diff --git a/updatecli/updatecli.d/weekly.d/jdk11.yml b/updatecli/updatecli.d/weekly.d/jdk11.yml index ed9917d..0a77f3d 100644 --- a/updatecli/updatecli.d/weekly.d/jdk11.yml +++ b/updatecli/updatecli.d/weekly.d/jdk11.yml @@ -26,29 +26,17 @@ sources: kind: regex # jdk-11.0.12+7(https://github.com/adoptium/temurin11-binaries/releases/tag/jdk-11.0.12%2B7) is OK pattern: "^jdk-11.(\\d*).(\\d*).(\\d*)+(\\d*)$" - transformers: - - trimprefix: "jdk-" - -conditions: - checkIfReleaseIsAvailable: - kind: shell - spec: - command: bash ./updatecli/scripts/check-jdk.sh # source input value passed as argument targets: updateJDK11Version: name: Update the JDK11 version in JDK11 Maven Nanoserver image - scmid: default kind: dockerfile spec: file: maven/jdk11/Dockerfile.nanoserver instruction: keyword: "ARG" matcher: "JAVA_VERSION" - transformers: - - replacer: - from: + - to: _ + scmid: default actions: default: diff --git a/updatecli/updatecli.d/weekly.d/jdk17.yml b/updatecli/updatecli.d/weekly.d/jdk17.yml index f1c7a39..40a58b4 100644 --- a/updatecli/updatecli.d/weekly.d/jdk17.yml +++ b/updatecli/updatecli.d/weekly.d/jdk17.yml @@ -27,29 +27,17 @@ sources: # 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: "^jdk-17.(\\d*).(\\d*).(\\d*)(.(\\d*))+(\\d*)$" - transformers: - - trimprefix: "jdk-" - -conditions: - checkIfReleaseIsAvailable: - kind: shell - spec: - command: bash ./updatecli/scripts/check-jdk.sh # source input value passed as argument targets: updateJDK17Version: name: Update the JDK17 version in the JDK17 Maven Nanoserver image - scmid: default kind: dockerfile spec: file: maven/jdk17/Dockerfile.nanoserver instruction: keyword: "ARG" matcher: "JAVA_VERSION" - transformers: - - replacer: - from: + - to: _ + scmid: default actions: default: diff --git a/updatecli/updatecli.d/weekly.d/jdk21.yml b/updatecli/updatecli.d/weekly.d/jdk21.yml new file mode 100644 index 0000000..aa20cad --- /dev/null +++ b/updatecli/updatecli.d/weekly.d/jdk21.yml @@ -0,0 +1,50 @@ +--- +name: Bump JDK21 version + +scms: + default: + kind: github + spec: + user: "{{ .github.user }}" + email: "{{ .github.email }}" + owner: "{{ .github.owner }}" + repository: "{{ .github.repository }}" + token: "{{ requiredEnv .github.token }}" + username: "{{ .github.username }}" + branch: "{{ .github.branch }}" + +sources: + lastReleaseVersion: + kind: githubrelease + name: Get the latest Adoptium JDK21 version + spec: + owner: "adoptium" + repository: "temurin21-binaries" + token: "{{ requiredEnv .github.token }}" + username: "{{ .github.username }}" + versionfilter: + kind: regex + # jdk-21.0.2+8(https://github.com/adoptium/temurin21-binaries/releases/tag/jdk-21.0.2%2B8) is OK + # jdk-21.0.4.1+1(https://github.com/adoptium/temurin21-binaries/releases/tag/jdk-21.0.4.1%2B1) is OK + pattern: "^jdk-21.(\\d*).(\\d*).(\\d*)(.(\\d*))+(\\d*)$" + +targets: + updateJDK21Version: + name: Update the JDK21 version in the JDK21 Maven Nanoserver image + kind: dockerfile + spec: + file: maven/jdk21/Dockerfile.nanoserver + instruction: + keyword: "ARG" + matcher: "JAVA_VERSION" + scmid: default + +actions: + default: + kind: github/pullrequest + title: Bump JDK21 version to {{ source "lastReleaseVersion" }} + scmid: default + spec: + labels: + - enhancement + - jdk21 diff --git a/updatecli/updatecli.d/weekly.d/jdk8.yml b/updatecli/updatecli.d/weekly.d/jdk8.yml index 734d9f1..f73b240 100644 --- a/updatecli/updatecli.d/weekly.d/jdk8.yml +++ b/updatecli/updatecli.d/weekly.d/jdk8.yml @@ -26,18 +26,9 @@ sources: kind: regex # (https://github.com/adoptium/temurin8-binaries/releases/tag/jdk8u345-b01) is OK but jdk8u302-b08.1 is not pattern: "^jdk8u(\\d*)-b(\\d*)$" - transformers: - - trimprefix: "jdk" - -conditions: - checkIfReleaseIsAvailable: - kind: shell - spec: - command: bash ./updatecli/scripts/check-jdk.sh # source input value passed as argument targets: updateJDK8Version: - scmid: default name: Update the JDK8 version in the JDK8 Maven Nanoserver image kind: dockerfile spec: @@ -45,6 +36,7 @@ targets: instruction: keyword: "ARG" matcher: "JAVA_VERSION" + scmid: default actions: default: