Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(dependencies): Use updatecli to track JDK 11, 17 and 21 #1711

Merged
merged 23 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
f6e294e
chore(dependencies): Updatecli manifests for HDJ 11,17 and 21.
gounthar Sep 18, 2023
17c4639
Merge branch 'master' into updatecli-for-java-manifests
gounthar Sep 18, 2023
f8beb28
Merge branch 'origin/updatecli-for-java' into updatecli-for-java-mani…
gounthar Sep 18, 2023
7474643
Merge remote-tracking branch 'upstream/master' into updatecli-for-jav…
gounthar Sep 18, 2023
4339981
Merge remote-tracking branch 'upstream/master' into updatecli-for-jav…
gounthar Sep 18, 2023
ac5cec9
fix(updatecli): Works with updatecli 0.61.0.
gounthar Sep 19, 2023
9fc9a30
fix(updatecli): Works with updatecli 0.61.0.
gounthar Sep 19, 2023
48596f7
fix(updatecli): Works with updatecli 0.61.0.
gounthar Sep 19, 2023
851b4ed
fix(updatecli): Misprint.
gounthar Sep 19, 2023
a1f889a
Merge branch 'master' into updatecli-for-java-manifests
gounthar Sep 19, 2023
e27476f
Update .github/workflows/sync-plugin-manager.yml
gounthar Sep 19, 2023
5bf7295
fix(indentation): After Damien's review.
gounthar Sep 19, 2023
f1130aa
fix(docker): Clean up
gounthar Sep 20, 2023
8fecf70
fix(docker): No more static build number.
gounthar Sep 23, 2023
d349ed9
fix(docker): No more static build number.
gounthar Sep 23, 2023
da4b2f6
fix(docker): No more static build number.
gounthar Sep 23, 2023
0dfccf1
fix(docker): No more static build number.
gounthar Sep 23, 2023
671f78e
Merge branch 'master' into updatecli-for-java-manifests
dduportal Sep 23, 2023
98fdc92
Merge branch 'master' into updatecli-for-java-manifests
gounthar Sep 24, 2023
8cd6f43
fix(dependencies): Dependabot should ignore new Java versions.
gounthar Sep 24, 2023
49597ef
Merge branch 'master' into updatecli-for-java-manifests
dduportal Sep 24, 2023
82f0633
fix(dependencies): Use ARG instead of FROM
gounthar Sep 25, 2023
e5d7b6c
Merge branch 'master' into updatecli-for-java-manifests
gounthar Sep 25, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion 11/windows/windowsservercore-2019/hotspot/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# escape=`
FROM eclipse-temurin:11.0.20.1_1-jdk-windowsservercore-1809
ARG JAVA_VERSION=11.0.20.1_1
FROM eclipse-temurin:"${JAVA_VERSION}"-jdk-windowsservercore-1809
# hadolint shell=powershell

ARG user=jenkins
Expand Down
3 changes: 2 additions & 1 deletion 17/rhel/ubi9/hotspot/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM eclipse-temurin:17.0.8.1_1-jdk-ubi9-minimal as jre-build
ARG JAVA_VERSION=17.0.8.1_1
FROM eclipse-temurin:"${JAVA_VERSION}"-jdk-ubi9-minimal as jre-build

# Generate smaller java runtime without unneeded files
# for now we include the full module path to maintain compatibility
Expand Down
73 changes: 73 additions & 0 deletions updatecli/scripts/check-jdk.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
#!/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
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;;
19*)
## JDK19 URLs have an underscore ('_') instead of a plus ('+') in their archive names
echo "https://github.com/adoptium/temurin19-binaries/releases/download/jdk-${jdk_version}/OpenJDK19U-jdk_${platform}_hotspot_${jdk_version//+/_}";
return 0;;
21*)
# JDK version (21+35-ea-beta)
## https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21%2B35-ea-beta/OpenJDK21U-jdk_aarch64_linux_hotspot_ea_21-0-35.tar.gz
urlEncodedJDKVersion="${jdk_version//+/%2B}"
echo "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-${urlEncodedJDKVersion}-ea-beta/OpenJDK21U-jdk_${platform}_hotspot_ea_21-0-$(echo ${jdk_version} | cut -d '+' -f 2 | cut -d '-' -f 1)"
return 0;;
*)
echo "ERROR: unsupported JDK version (${jdk_version}).";
exit 1;;
esac
}

case "${1}" in
8u*)
# No s390x support for JDK8: $platforms is kept as default
platforms=("x64_linux" "x64_windows" "aarch64_linux");;
11.*)
platforms=("x64_linux" "x64_windows" "aarch64_linux" "s390x_linux");;
17.*+*)
platforms=("x64_linux" "x64_windows" "aarch64_linux" "s390x_linux");;
19.*+*)
platforms=("x64_linux" "x64_windows" "aarch64_linux" "s390x_linux");;
21*+*)
platforms=("x64_linux" "x64_windows" "aarch64_linux" "s390x_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."
163 changes: 163 additions & 0 deletions updatecli/updatecli.d/jdk11.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
---
name: Bump JDK11 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:
lastVersion:
kind: githubrelease
name: Get the latest Adoptium JDK11 version
spec:
owner: "adoptium"
repository: "temurin11-binaries"
token: "{{ requiredEnv .github.token }}"
username: "{{ .github.username }}"
versionfilter:
kind: regex
pattern: "^jdk-11.(\\d*).(\\d*).(\\d*)(.(\\d*))+(\\d*)$"
transformers:
- trimprefix: "jdk-"
- replacer:
from: +
to: _

conditions:
checkTemurinAlpineDockerImage:
kind: dockerimage
name: Check if the container image "eclipse-temurin:<lastVersion>-jdk-alpine" is available
disablesourceinput: true
spec:
architecture: amd64
image: eclipse-temurin
tag: '{{source "lastVersion" }}-jdk-alpine'
checkTemurinDebianDockerImages:
kind: dockerimage
name: Check if the container image "eclipse-temurin:<lastVersion>-jdk-jammy" is available
disablesourceinput: true
spec:
architectures:
- amd64
- arm64
- s390x
- linux/arm/v7
image: eclipse-temurin
tag: '{{source "lastVersion" }}-jdk-jammy'
checkTemurinNanoserver2019DockerImage:
kind: dockerimage
name: Check if the container image "eclipse-temurin:<lastVersion>-jdk-nanoserver-1809" is available
disablesourceinput: true
spec:
# architecture: amd64
image: eclipse-temurin
tag: '{{source "lastVersion" }}-jdk-nanoserver-1809'
checkTemurinWindowsCore2019DockerImage:
kind: dockerimage
name: Check if the container image "eclipse-temurin:<lastVersion>-jdk-windowsservercore-1809" is available
disablesourceinput: true
spec:
# architecture: amd64
image: eclipse-temurin
tag: '{{source "lastVersion" }}-jdk-windowsservercore-1809'
checkTemurinNanoserver2022DockerImage:
kind: dockerimage
name: Check if the container image "eclipse-temurin:<lastVersion>-jdk-nanoserver-ltsc2022" is available
disablesourceinput: true
spec:
# architecture: amd64
image: eclipse-temurin
tag: '{{source "lastVersion" }}-jdk-nanoserver-ltsc2022'
checkTemurinWindowsCore2022DockerImage:
kind: dockerimage
name: Check if the container image "eclipse-temurin:<lastVersion>-jdk-windowsservercore-18ltsc202209" is available
disablesourceinput: true
spec:
# architecture: amd64
image: eclipse-temurin
tag: '{{source "lastVersion" }}-jdk-windowsservercore-ltsc2022'

targets:
setJDK11VersionDockerBake:
name: "Bump JDK11 version for Linux images in the docker-bake.hcl file"
kind: hcl
spec:
file: docker-bake.hcl
path: variable.JAVA11_VERSION.default
scmid: default
setJDK11VersionAlmaLinux8:
name: "Bump JDK11 version for Linux images in the Alma Linux 8 Dockerfile"
kind: dockerfile
spec:
file: 11/almalinux/almalinux8/hotspot/Dockerfile
instruction:
keyword: ARG
matcher: JAVA_VERSION
scmid: default
setJDK11VersionAlpine:
name: "Bump JDK11 version for Linux images in the Alpine Linux Dockerfile"
kind: dockerfile
spec:
file: 11/alpine/hotspot/Dockerfile
instruction:
keyword: "FROM"
matcher: "eclipse-temurin"
transformers:
- addsuffix: "-jdk-alpine"
scmid: default
setJDK11VersionDebian:
name: "Bump JDK11 version for Linux images in the Debian Dockerfile"
kind: dockerfile
spec:
file: 11/debian/bookworm/hotspot/Dockerfile
instruction:
keyword: ARG
matcher: JAVA_VERSION
scmid: default
setJDK11VersionDebianSlim:
name: "Bump JDK11 version for Linux images in the Debian Slim Dockerfile"
kind: dockerfile
spec:
file: 11/debian/bookworm-slim/hotspot/Dockerfile
instruction:
keyword: ARG
matcher: JAVA_VERSION
scmid: default
setJDK11VersionRhel:
name: "Bump JDK11 version for Linux images in the Rhel Dockerfile"
kind: dockerfile
spec:
file: 11/rhel/ubi8/hotspot/Dockerfile
instruction:
keyword: ARG
matcher: JAVA_VERSION
scmid: default
setJDK11VersionWindows:
name: "Bump JDK11 version for Linux images in the Windows Dockerfile"
kind: dockerfile
spec:
file: 11/windows/windowsservercore-2019/hotspot/Dockerfile
instruction:
keyword: "FROM"
matcher: "eclipse-temurin"
transformers:
- addsuffix: "-jdk-windowsservercore-1809"
scmid: default

actions:
default:
kind: github/pullrequest
scmid: default
title: Bump JDK11 version to {{ source "lastVersion" }}
spec:
labels:
- dependencies
- jdk11
146 changes: 146 additions & 0 deletions updatecli/updatecli.d/jdk17.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
---
name: Bump JDK17 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:
lastVersion:
kind: githubrelease
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.12+7(https://github.com/adoptium/temurin17-binaries/releases/tag/jdk-17.0.12%2B7) is OK
# jdk-17.0.16.1+1 (https://github.com/adoptium/temurin17-binaries/releases/tag/jdk-17.0.16.1%2B1) is OK
pattern: "^jdk-17.(\\d*).(\\d*).(\\d*)(.(\\d*))+(\\d*)$"
transformers:
- trimprefix: "jdk-"
- replacer:
from: +
to: _

conditions:
checkTemurinAlpineDockerImage:
kind: dockerimage
name: Check if the container image "eclipse-temurin:<lastVersion>-jdk-alpine" is available
disablesourceinput: true
spec:
image: eclipse-temurin
tag: '{{source "lastVersion" }}-jdk-alpine'
checkTemurinDebianDockerImages:
kind: dockerimage
name: Check if the container image "eclipse-temurin:<lastVersion>-jdk-focal" is available
disablesourceinput: true
spec:
architectures:
- amd64
- arm64
- s390x
- linux/arm/v7
image: eclipse-temurin
tag: '{{source "lastVersion" }}-jdk-focal'
checkTemurinNanoserver2019DockerImage:
kind: dockerimage
name: Check if the container image "eclipse-temurin:<lastVersion>-jdk-nanoserver-1809" is available
disablesourceinput: true
spec:
image: eclipse-temurin
tag: '{{source "lastVersion" }}-jdk-nanoserver-1809'
checkTemurinWindowsCore2019DockerImage:
kind: dockerimage
name: Check if the container image "eclipse-temurin:<lastVersion>-jdk-windowsservercore-1809" is available
disablesourceinput: true
spec:
image: eclipse-temurin
tag: '{{source "lastVersion" }}-jdk-windowsservercore-1809'
checkTemurinNanoserver2022DockerImage:
kind: dockerimage
name: Check if the container image "eclipse-temurin:<lastVersion>-jdk-nanoserver-ltsc2022" is available
disablesourceinput: true
spec:
image: eclipse-temurin
tag: '{{source "lastVersion" }}-jdk-nanoserver-ltsc2022'
checkTemurinWindowsCore2022DockerImage:
kind: dockerimage
name: Check if the container image "eclipse-temurin:<lastVersion>-jdk-windowsservercore-18ltsc202209" is available
disablesourceinput: true
spec:
image: eclipse-temurin
tag: '{{source "lastVersion" }}-jdk-windowsservercore-ltsc2022'

targets:
setJDK17VersionDockerBake:
name: "Bump JDK17 version for Linux images in the docker-bake.hcl file"
kind: hcl
spec:
file: docker-bake.hcl
path: variable.JAVA17_VERSION.default
scmid: default
setJDK17VersionAlpine:
name: "Bump JDK17 version for Linux images in the Alpine Linux Dockerfile"
kind: dockerfile
spec:
file: 17/alpine/hotspot/Dockerfile
instruction:
keyword: "FROM"
matcher: "eclipse-temurin"
transformers:
- addsuffix: "-jdk-alpine"
scmid: default
setJDK17VersionDebian:
name: "Bump JDK17 version for Linux images in the Debian Dockerfile"
kind: dockerfile
spec:
file: 17/debian/bookworm/hotspot/Dockerfile
instruction:
keyword: "FROM"
matcher: "eclipse-temurin"
transformers:
- addsuffix: "-jdk-jammy"
scmid: default
setJDK17VersionDebianSlim:
name: "Bump JDK17 version for Linux images in the Debian Slim Dockerfile"
kind: dockerfile
spec:
file: 17/debian/bookworm-slim/hotspot/Dockerfile
instruction:
keyword: "FROM"
matcher: "eclipse-temurin"
transformers:
- addsuffix: "-jdk-jammy"
scmid: default
setJDK17VersionRhel:
name: "Bump JDK17 version for Linux images in the Rhel Dockerfile"
kind: dockerfile
spec:
file: 17/rhel/ubi9/hotspot/Dockerfile
instruction:
keyword: "FROM"
matcher: "eclipse-temurin"
transformers:
- addsuffix: "-jdk-ubi9-minimal"
scmid: default

actions:
default:
kind: github/pullrequest
scmid: default
title: Bump JDK17 version to {{ source "lastVersion" }}
spec:
labels:
- dependencies
- jdk17
Loading