Skip to content

Commit

Permalink
Merge branch 'master' into s390x-jdk21
Browse files Browse the repository at this point in the history
  • Loading branch information
gounthar authored Mar 26, 2024
2 parents 7becf2f + 518f9fe commit ace49aa
Show file tree
Hide file tree
Showing 12 changed files with 72 additions and 53 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/updatecli.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ jobs:
uses: updatecli/[email protected]

- name: Run Updatecli in Dry Run mode
run: updatecli diff --config ./updatecli/updatecli.d --values ./updatecli/values.github-action.yaml
run: updatecli diff --config ./updatecli/updatecli.d --values ./updatecli/values.github-action.yaml --values ./updatecli/values.temurin.yaml
env:
UPDATECLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Run Updatecli in Apply mode
if: github.ref == 'refs/heads/master'
run: updatecli apply --config ./updatecli/updatecli.d --values ./updatecli/values.github-action.yaml
run: updatecli apply --config ./updatecli/updatecli.d --values ./updatecli/values.github-action.yaml --values ./updatecli/values.temurin.yaml
env:
UPDATECLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ list: check-reqs
@set -x; make --silent show | jq -r '.target | path(.. | select(.platforms[] | contains("linux/$(ARCH)"))?) | add'

bats:
git clone --branch v1.10.0 https://github.com/bats-core/bats-core bats
git clone --branch v1.11.0 https://github.com/bats-core/bats-core bats

prepare-test: bats check-reqs
git submodule update --init --recursive
Expand Down
2 changes: 1 addition & 1 deletion alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

ARG JAVA_VERSION=17.0.8.1_1
ARG JAVA_VERSION=17.0.10_7
ARG ALPINE_TAG=3.19.1
FROM eclipse-temurin:"${JAVA_VERSION}"-jdk-alpine AS jre-build

Expand Down
2 changes: 1 addition & 1 deletion debian/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG JAVA_VERSION=17.0.8.1_1
ARG JAVA_VERSION=17.0.10_7
ARG DEBIAN_RELEASE=bookworm-20240311
FROM eclipse-temurin:"${JAVA_VERSION}"-jdk-jammy AS jre-build

Expand Down
5 changes: 3 additions & 2 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ group "linux" {
"alpine_jdk17",
"alpine_jdk21",
"debian_jdk11",
"debian_jdk17",
"debian_jdk21",
"debian_jdk21-preview",
]
Expand Down Expand Up @@ -64,11 +65,11 @@ variable "ALPINE_SHORT_TAG" {
}

variable "JAVA11_VERSION" {
default = "11.0.20.1_1"
default = "11.0.22_7"
}

variable "JAVA17_VERSION" {
default = "17.0.8.1_1"
default = "17.0.10_7"
}

variable "JAVA21_VERSION" {
Expand Down
24 changes: 17 additions & 7 deletions updatecli/scripts/check-jdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# 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
set -eu -o pipefail

command -v curl >/dev/null 2>&1 || { echo "ERROR: curl command not found. Exiting."; exit 1; }

Expand All @@ -29,12 +29,20 @@ function get_jdk_download_url() {
## 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*-ea-beta)
# JDK preview version (21+35-ea-beta, 21.0.1+12-ea-beta)
# This has been updated to support the new inferred URL pattern that started as of 21.0.3+2-ea-beta. It will not work for earlier preview versions.
# One could update the cases to support all preview versions, if desired.
jdk_version="${jdk_version//-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
## https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.1%2B12-ea-beta/OpenJDK21U-jdk_x64_linux_hotspot_ea_21-0-1-12.tar.gz
dashJDKVersion="${jdk_version//+/_}"
jdk_version="${jdk_version//-ea}"
echo "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-${jdk_version//+/%2B}-ea-beta/OpenJDK21U-jdk_${platform}_hotspot_${dashJDKVersion}"
return 0;;
21*)
# TODO: Check both generally available and early access versions, as both are in use within this repository
# JDK version (21.0.1+12-ea-beta)
## https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21%2B35-ea-beta/OpenJDK21U-jdk_aarch64_linux_hotspot_ea_21-0-1-12.tar.gz
urlEncodedJDKVersion="${jdk_version//+/%2B}"
echo "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-${urlEncodedJDKVersion}-ea-beta/OpenJDK21U-jdk_${platform}_hotspot_ea_$(echo ${jdk_version} | sed 's/+/-/g;s/\./-/g')"
## 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}).";
Expand All @@ -52,8 +60,10 @@ case "${1}" in
platforms=("x64_linux" "x64_windows" "aarch64_linux" "s390x_linux");;
19.*+*)
platforms=("x64_linux" "x64_windows" "aarch64_linux" "s390x_linux");;
21*+*)
21*+*-ea-beta)
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;;
Expand Down
20 changes: 10 additions & 10 deletions updatecli/updatecli.d/jdk11.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ scms:
sources:
jdk11LastVersion:
kind: githubrelease
name: Get the latest Temurin JDK11 version
name: Get the latest Adoptium JDK11 version
spec:
owner: "adoptium"
repository: "temurin11-binaries"
token: "{{ requiredEnv .github.token }}"
username: "{{ .github.username }}"
versionfilter:
kind: regex
# jdk-11.0.20+8 ()https://github.com/adoptium/temurin11-binaries/releases/tag/jdk-11.0.20%2B8) is OK
# jdk-11.0.20.1+1(https://github.com/adoptium/temurin11-binaries/releases/tag/jdk-11.0.20.1%2B1) is OK
pattern: "^jdk-11.(\\d*).(\\d*).(\\d*)(.(\\d*))+(\\d*)$"
# jdk-11.0.12+7(https://github.com/adoptium/temurin11-binaries/releases/tag/jdk-11.0.12%2B7) is OK
# jdk-11.0.16.1+1 (https://github.com/adoptium/temurin11-binaries/releases/tag/jdk-11.0.16.1%2B1) is OK
pattern: {{ .temurin.version_pattern }}
transformers:
- trimprefix: "jdk-"
- replacer:
Expand All @@ -37,31 +37,31 @@ conditions:
checkTemurinJDK11AlpineDockerImage:
kind: dockerimage
name: Check if the container image "eclipse-temurin:<jdk11LastVersion>-jdk-alpine" is available
disablesourceinput: true
transformers:
- addsuffix: "-jdk-alpine"
spec:
architecture: linux/amd64
image: eclipse-temurin
tag: '{{source "jdk11LastVersion" }}-jdk-alpine'
checkTemurinJDK11DebianDockerImages:
kind: dockerimage
name: Check if the container image "eclipse-temurin:<jdk11LastVersion>-jdk-jammy" is available
disablesourceinput: true
transformers:
- addsuffix: "-jdk-jammy"
spec:
architectures:
- linux/amd64
- linux/arm64
- linux/s390x
- linux/arm/v7
image: eclipse-temurin
tag: '{{source "jdk11LastVersion" }}-jdk-jammy'
checkTemurinJDK11WindowsCoreDockerImage:
kind: dockerimage
name: Check if the container image "eclipse-temurin:<jdk11LastVersion>-jdk-windowsservercore-1809" is available
disablesourceinput: true
transformers:
- addsuffix: "-jdk-windowsservercore-1809"
spec:
architecture: windows/amd64
image: eclipse-temurin
tag: '{{source "jdk11LastVersion" }}-jdk-windowsservercore-1809'

targets:
setJDK11VersionNanoServer:
Expand Down
18 changes: 9 additions & 9 deletions updatecli/updatecli.d/jdk17.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ scms:
sources:
jdk17LastVersion:
kind: githubrelease
name: Get the latest Temurin JDK17 version
name: Get the latest Adoptium JDK17 version
spec:
owner: "adoptium"
repository: "temurin17-binaries"
Expand All @@ -26,7 +26,7 @@ sources:
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: "^jdk-17.(\\d*).(\\d*).(\\d*)(.(\\d*))+(\\d*)$"
pattern: {{ .temurin.version_pattern }}
transformers:
- trimprefix: "jdk-"
- replacer:
Expand All @@ -37,31 +37,31 @@ conditions:
checkTemurinJDK17AlpineDockerImage:
kind: dockerimage
name: Check if the container image "eclipse-temurin:<jdk17LastVersion>-jdk-alpine" is available
disablesourceinput: true
transformers:
- addsuffix: "-jdk-alpine"
spec:
architecture: linux/amd64
image: eclipse-temurin
tag: '{{source "jdk17LastVersion" }}-jdk-alpine'
checkTemurinJDK17DebianDockerImages:
kind: dockerimage
name: Check if the container image "eclipse-temurin:<jdk17LastVersion>-jdk-jammy" is available
disablesourceinput: true
name: Check if the container image "eclipse-temurin:<jdk17LastVersion>-jdk-focal" is available
transformers:
- addsuffix: "-jdk-focal"
spec:
architectures:
- linux/amd64
- linux/arm64
- linux/s390x
- linux/arm/v7
image: eclipse-temurin
tag: '{{source "jdk17LastVersion" }}-jdk-jammy'
checkTemurinJDK17WindowsCoreDockerImage:
kind: dockerimage
name: Check if the container image "eclipse-temurin:<jdk17LastVersion>-jdk-windowsservercore-1809" is available
disablesourceinput: true
transformers:
- addsuffix: "-jdk-windowsservercore-1809"
spec:
architecture: windows/amd64
image: eclipse-temurin
tag: '{{source "jdk17LastVersion" }}-jdk-windowsservercore-1809'

targets:
setJDK17VersionDockerBake:
Expand Down
42 changes: 24 additions & 18 deletions updatecli/updatecli.d/jdk21.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,55 +12,61 @@ scms:
token: "{{ requiredEnv .github.token }}"
username: "{{ .github.username }}"
branch: "{{ .github.branch }}"
temurin21-binaries:
kind: "github"
spec:
user: "{{ .github.user }}"
email: "{{ .github.email }}"
owner: "adoptium"
repository: "temurin21-binaries"
token: '{{ requiredEnv .github.token }}'
branch: "main"

sources:
jdk21LastVersion:
kind: githubrelease
name: Get the latest Temurin JDK21 version
name: Get the latest Adoptium JDK21 version
kind: gittag
scmid: temurin21-binaries
spec:
owner: "adoptium"
repository: "temurin21-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: "^jdk-21.(\\d*).(\\d*).(\\d*)(.(\\d*))+(\\d*)$"
pattern: {{ .temurin.version_pattern }}
transformers:
- trimprefix: "jdk-"
- replacer:
from: +
to: _
from: "+"
to: "_"

conditions:
checkTemurinJDK21AlpineDockerImage:
kind: dockerimage
name: Check if the container image "eclipse-temurin:<jdk21LastVersion>-jdk-alpine" is available
disablesourceinput: true
transformers:
- addsuffix: "-jdk-alpine"
spec:
architecture: linux/amd64
architectures:
- linux/amd64
- linux/arm64
image: eclipse-temurin
tag: '{{source "jdk21LastVersion" }}-jdk-alpine'
checkTemurinJDK21DebianDockerImages:
kind: dockerimage
name: Check if the container image "eclipse-temurin:<jdk21LastVersion>-jdk-jammy" is available
disablesourceinput: true
transformers:
- addsuffix: "-jdk-jammy"
spec:
architectures:
- linux/amd64
- linux/arm64
- linux/s390x
image: eclipse-temurin
tag: '{{source "jdk21LastVersion" }}-jdk-jammy'
checkTemurinJDK21WindowsCoreDockerImage:
kind: dockerimage
name: Check if the container image "eclipse-temurin:<jdk21LastVersion>-jdk-windowsservercore-1809" is available
disablesourceinput: true
transformers:
- addsuffix: "-jdk-windowsservercore-1809"
spec:
architecture: windows/amd64
image: eclipse-temurin
tag: '{{source "jdk21LastVersion" }}-jdk-windowsservercore-1809'

targets:
setJDK21VersionDockerBake:
Expand Down
2 changes: 2 additions & 0 deletions updatecli/values.temurin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
temurin:
version_pattern: "^jdk-[11|17|21].(\\d*).(\\d*).(\\d*)(.(\\d*))\\+(\\d*)?$"
2 changes: 1 addition & 1 deletion windows/nanoserver-ltsc2019/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
ARG JAVA_VERSION=11.0.20.1_1
ARG JAVA_VERSION=11.0.22_7
FROM eclipse-temurin:"${JAVA_VERSION}"-jdk-windowsservercore-1809 AS jdk-core

FROM mcr.microsoft.com/powershell:nanoserver-1809
Expand Down
2 changes: 1 addition & 1 deletion windows/windowsservercore-ltsc2019/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

ARG JAVA_VERSION=11.0.20.1_1
ARG JAVA_VERSION=11.0.22_7
FROM eclipse-temurin:"${JAVA_VERSION}"-jdk-windowsservercore-1809

SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
Expand Down

0 comments on commit ace49aa

Please sign in to comment.