Skip to content

Commit

Permalink
chore(updatecli): Uses the native temurin source (#1957)
Browse files Browse the repository at this point in the history
* feat(updatecli): Uses the Temurin source

* feat(updatecli): Uses a direct URL to download the Temurin binary.

* feat(updatecli): Ideal manifest

* fix(updatecli): Group platforms

* feat(updatecli): Ideal manifest

* WiP second source

* fix(updatecli): Uses the transformers in the targets.

* fix(updatecli): No need to add windows on arm or riscv64 for the time being.

* feat(updatecli): Uses the Temurin source

* feat(updatecli): Uses the Temurin source

* fix(updatecli): Comments.

* chore(ga): Latest updatecli GitHub Action

* fix(updatecli): Apply suggestions from code review

Co-authored-by: lemeurherveCB <[email protected]>

* fix(updatecli): Remove unnecessary comments.

* fix(updatecli): Remove unnecessary comments.

* fix(updatecli): Remove unnecessary space.

---------

Co-authored-by: lemeurherveCB <[email protected]>
  • Loading branch information
gounthar and lemeurherveCB authored Nov 27, 2024
1 parent c45202b commit 6f43191
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 116 deletions.
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: +
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

0 comments on commit 6f43191

Please sign in to comment.