Skip to content

Commit

Permalink
Merge pull request #905 from gounthar/temurin-source
Browse files Browse the repository at this point in the history
chore(updatecli): Use the native temurin source
  • Loading branch information
dduportal authored Nov 27, 2024
2 parents 54e97b9 + d5f6369 commit c6fcec5
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 179 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/updatecli.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,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.

90 changes: 26 additions & 64 deletions updatecli/updatecli.d/jdk17.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,89 +15,47 @@ scms:

sources:
lastVersion:
kind: githubrelease
name: Get the latest Adoptium JDK17 version
kind: temurin
name: Get the latest Adoptium JDK17 version via the API
spec:
owner: "adoptium"
repository: "temurin17-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: {{ .temurin.version_pattern }}
featureversion: 17
transformers:
- trimprefix: "jdk-"
- replacer:
from: +
to: _

conditions:
checkTemurinAlpineDockerImage:
kind: dockerimage
name: Check if the container image "eclipse-temurin:<lastVersion>-jdk-alpine" is available
transformers:
- addsuffix: "-jdk-alpine"
spec:
architecture: linux/amd64
image: eclipse-temurin
checkTemurinDebianDockerImages:
kind: dockerimage
name: Check if the container image "eclipse-temurin:<lastVersion>-jdk-jammy" is available
transformers:
- addsuffix: "-jdk-jammy"
checkTemurinAllReleases:
name: Check if the "<lastVersion>" is available for all platforms
kind: temurin
sourceid: lastVersion
spec:
architectures:
- linux/amd64
- linux/arm64
featureversion: 17
platforms:
- alpine-linux/x64
- linux/x64
- linux/aarch64
- linux/ppc64le
- linux/s390x
- linux/arm/v7
image: eclipse-temurin
checkTemurinNanoserver2019DockerImage:
kind: dockerimage
name: Check if the container image "eclipse-temurin:<lastVersion>-jdk-nanoserver-1809" is available
transformers:
- addsuffix: "-jdk-nanoserver-1809"
spec:
architecture: windows/amd64
image: eclipse-temurin
checkTemurinWindowsCore2019DockerImage:
kind: dockerimage
name: Check if the container image "eclipse-temurin:<lastVersion>-jdk-windowsservercore-1809" is available
transformers:
- addsuffix: "-jdk-windowsservercore-1809"
spec:
architecture: windows/amd64
image: eclipse-temurin
checkTemurinNanoserver2022DockerImage:
kind: dockerimage
name: Check if the container image "eclipse-temurin:<lastVersion>-jdk-nanoserver-ltsc2022" is available
transformers:
- addsuffix: "-jdk-nanoserver-ltsc2022"
spec:
architecture: windows/amd64
image: eclipse-temurin
checkTemurinWindowsCore2022DockerImage:
kind: dockerimage
name: Check if the container image "eclipse-temurin:<lastVersion>-jdk-windowsservercore-ltsc2022" is available
transformers:
- addsuffix: "-jdk-windowsservercore-ltsc2022"
spec:
architecture: windows/amd64
image: eclipse-temurin
- windows/x64

targets:
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
setJDK17VersionAlpine:
name: "Bump JDK17 default ARG version on Alpine Dockerfile"
kind: dockerfile
transformers:
- replacer:
from: "+"
to: "_"
spec:
file: alpine/Dockerfile
instruction:
Expand All @@ -107,6 +65,10 @@ targets:
setJDK17VersionDebian:
name: "Bump JDK17 default ARG version on Debian Dockerfile"
kind: dockerfile
transformers:
- replacer:
from: "+"
to: "_"
spec:
file: debian/Dockerfile
instruction:
Expand Down
84 changes: 22 additions & 62 deletions updatecli/updatecli.d/jdk21.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,79 +23,39 @@ scms:
branch: "main"

sources:
getLatestJDK21Version:
name: Get the latest Adoptium JDK21 version
kind: gittag
scmid: temurin21-binaries
latestJDK21Version:
kind: temurin
name: Get the latest Adoptium JDK21 version via the API
spec:
versionfilter:
kind: regex
pattern: {{ .temurin.version_pattern }}
featureversion: 21
transformers:
- trimprefix: "jdk-"
- replacer:
from: "+"
to: "_"

# Architectures must match those of the targets in docker-bake.hcl
conditions:
checkTemurinAlpineDockerImage:
kind: dockerimage
name: Check if the container image "eclipse-temurin:<lastVersion>-jdk-alpine" is available
transformers:
- addsuffix: "-jdk-alpine"
spec:
architectures:
- linux/amd64
- linux/arm64
image: eclipse-temurin
checkTemurinDebianDockerImages:
kind: dockerimage
name: Check if the container image "eclipse-temurin:<lastVersion>-jdk-jammy" is available
transformers:
- addsuffix: "-jdk-jammy"
spec:
architectures:
- linux/amd64
- linux/arm64
image: eclipse-temurin
checkTemurinNanoserver2019DockerImage:
kind: dockerimage
name: Check if the container image "eclipse-temurin:<lastVersion>-jdk-nanoserver-1809" is available
transformers:
- addsuffix: "-jdk-nanoserver-1809"
spec:
architecture: windows/amd64
image: eclipse-temurin
checkTemurinWindowsCore2019DockerImage:
kind: dockerimage
name: Check if the container image "eclipse-temurin:<lastVersion>-jdk-windowsservercore-1809" is available
transformers:
- addsuffix: "-jdk-windowsservercore-1809"
spec:
architecture: windows/amd64
image: eclipse-temurin
checkTemurinNanoserver2022DockerImage:
kind: dockerimage
name: Check if the container image "eclipse-temurin:<lastVersion>-jdk-nanoserver-ltsc2022" is available
transformers:
- addsuffix: "-jdk-nanoserver-ltsc2022"
spec:
architecture: windows/amd64
image: eclipse-temurin
checkTemurinWindowsCore2022DockerImage:
kind: dockerimage
name: Check if the container image "eclipse-temurin:<lastVersion>-jdk-windowsservercore-ltsc2022" is available
transformers:
- addsuffix: "-jdk-windowsservercore-ltsc2022"
checkTemurinAllReleases:
name: Check if the "<latestJDK21Version>" is available for all platforms
kind: temurin
sourceid: latestJDK21Version
spec:
architecture: windows/amd64
image: eclipse-temurin
featureversion: 21
platforms:
- alpine-linux/x64
- alpine-linux/aarch64
- linux/x64
- linux/aarch64
- linux/ppc64le
- linux/s390x
- windows/x64

targets:
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
Expand All @@ -105,7 +65,7 @@ actions:
default:
kind: github/pullrequest
scmid: default
title: Bump JDK21 version to {{ source "getLatestJDK21Version" }}
title: Bump JDK21 version to {{ source "latestJDK21Version" }}
spec:
labels:
- dependencies
Expand Down

0 comments on commit c6fcec5

Please sign in to comment.