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(updatecli): Uses the native temurin source #1957

Merged
merged 19 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
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
2 changes: 1 addition & 1 deletion .github/workflows/updatecli.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,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
Expand Down
52 changes: 0 additions & 52 deletions updatecli/scripts/check-jdk.sh

This file was deleted.

68 changes: 38 additions & 30 deletions updatecli/updatecli.d/jdk17.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,56 +15,48 @@ scms:

sources:
lastVersion:
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.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*)$"
featureversion: 17
transformers:
- trimprefix: "jdk-"
- replacer:
from: +
dduportal marked this conversation as resolved.
Show resolved Hide resolved
to: _

conditions:
checkTemurinAlpineRelease:
name: Check if the "<lastVersion>" is available for alpine
kind: shell
spec:
command: sh ./jdk-download-url.sh '{{source "lastVersion" }}' alpine "x64"
disablesourceinput: true
checkTemurinLinuxRelease:
name: Check if the "<lastVersion>" is available for Linux
kind: shell
spec:
command: sh ./jdk-download-url.sh '{{source "lastVersion" }}' standard "x64 aarch64 s390x"
disablesourceinput: true
checkTemurinWindowsRelease:
name: Check if the "<lastVersion>" is available for Windows
kind: shell
checkTemurinAllReleases:
name: Check if the "<lastVersion>" is available for all platforms
kind: temurin
sourceid: lastVersion
spec:
command: sh ./jdk-download-url.sh '{{source "lastVersion" }}' windows "x64"
disablesourceinput: true
featureversion: 17
platforms:
- alpine-linux/x64
- linux/x64
- linux/aarch64
- linux/ppc64le
- linux/s390x
- windows/x64

targets:
## Global config files
setJDK17VersionDockerBake:
name: "Bump JDK17 version for Linux images in the docker-bake.hcl file"
kind: hcl
transformers:
- replacer:
from: "+"
to: "_"
spec:
file: docker-bake.hcl
path: variable.JAVA17_VERSION.default
scmid: default
setJDK17VersionWindowsDockerCompose:
name: "Bump JDK17 version in build-windows.yaml"
kind: yaml
transformers:
- replacer:
from: "+"
to: "_"
spec:
files:
- build-windows.yaml
Expand All @@ -75,6 +67,10 @@ targets:
setJDK17VersionAlpine:
name: "Bump JDK17 version for Linux images in the Alpine Linux Dockerfile"
kind: dockerfile
transformers:
- replacer:
from: "+"
to: "_"
spec:
file: alpine/hotspot/Dockerfile
instruction:
Expand All @@ -84,6 +80,10 @@ targets:
setJDK17VersionDebian:
name: "Bump JDK17 version for Linux images in the Debian Dockerfiles"
kind: dockerfile
transformers:
- replacer:
from: "+"
to: "_"
spec:
files:
- debian/bookworm/hotspot/Dockerfile
Expand All @@ -95,6 +95,10 @@ targets:
setJDK17VersionRhel:
name: "Bump JDK17 version for Linux images in the Rhel Dockerfile"
kind: dockerfile
transformers:
- replacer:
from: "+"
to: "_"
spec:
file: rhel/ubi9/hotspot/Dockerfile
instruction:
Expand All @@ -104,6 +108,10 @@ targets:
setJDK17VersionWindowsDockerImage:
name: "Bump default JDK17 version for Linux images in the Windows Dockerfile"
kind: dockerfile
transformers:
- replacer:
from: "+"
to: "_"
spec:
file: windows/windowsservercore/hotspot/Dockerfile
instruction:
Expand Down
60 changes: 27 additions & 33 deletions updatecli/updatecli.d/jdk21.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
name: Bump JDK21 version

scms:
Expand All @@ -14,55 +13,50 @@ scms:
branch: "{{ .github.branch }}"

sources:
lastVersion:
kind: githubrelease
name: Get the latest Adoptium JDK21 version
lastTemurin21Version:
kind: temurin
name: Get the latest Adoptium JDK21 version via the API
spec:
owner: "adoptium"
repository: "temurin21-binaries"
token: "{{ requiredEnv .github.token }}"
username: "{{ .github.username }}"
versionfilter:
kind: regex
pattern: "^jdk-21.(\\d*).(\\d*).(\\d*)(.(\\d*))+(\\d*)$"
featureversion: 21
transformers:
- trimprefix: "jdk-"
- replacer:
from: +
to: _

conditions:
checkTemurinAlpineRelease:
name: Check if the "<lastVersion>" is available for alpine
kind: shell
spec:
command: sh ./jdk-download-url.sh '{{source "lastVersion" }}' alpine "x64"
disablesourceinput: true
checkTemurinLinuxRelease:
name: Check if the "<lastVersion>" is available for Linux
kind: shell
spec:
command: sh ./jdk-download-url.sh '{{source "lastVersion" }}' standard "x64 aarch64 s390x"
disablesourceinput: true
checkTemurinWindowsRelease:
name: Check if the "<lastVersion>" is available for Windows
kind: shell
checkTemurinAllReleases:
name: Check if the "<lastTemurin21Version>" is available for all platforms
kind: temurin
sourceid: lastTemurin21Version
spec:
command: sh ./jdk-download-url.sh '{{source "lastVersion" }}' windows "x64"
disablesourceinput: true
featureversion: 21
platforms:
- alpine-linux/x64
- alpine-linux/aarch64
- linux/x64
- linux/aarch64
- linux/ppc64le
- linux/s390x
- windows/x64

targets:
## Global config files
setJDK21VersionDockerBake:
name: "Bump JDK21 version for Linux images in the docker-bake.hcl file"
kind: hcl
transformers:
- replacer:
from: "+"
to: "_"
spec:
file: docker-bake.hcl
path: variable.JAVA21_VERSION.default
scmid: default

setJDK21VersionWindowsDockerCompose:
name: "Bump JDK21 version in build-windows.yaml"
kind: yaml
transformers:
- replacer:
from: "+"
to: "_"
spec:
files:
- build-windows.yaml
Expand All @@ -73,7 +67,7 @@ actions:
default:
kind: github/pullrequest
scmid: default
title: Bump JDK21 version to {{ source "lastVersion" }}
title: Bump JDK21 version to {{ source "lastTemurin21Version" }}
spec:
labels:
- dependencies
Expand Down