Skip to content

Commit

Permalink
feat(updatecli) Re-enable JDK updates
Browse files Browse the repository at this point in the history
Updatecli now wants us to get a more precise platform:  `linux/amd64` instead of `amd/64`, `windows/amd64` instead of `amd64`, and so on.
  • Loading branch information
gounthar committed Mar 22, 2024
1 parent 2d69ed2 commit ca5e349
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 56 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 }}
32 changes: 16 additions & 16 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: amd64
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:
- amd64
- arm64
- s390x
- arm/v7
- 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: amd64
architecture: windows/amd64
image: eclipse-temurin
tag: '{{source "jdk11LastVersion" }}-jdk-windowsservercore-1809'

targets:
setJDK11VersionNanoServer:
Expand Down
30 changes: 15 additions & 15 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: amd64
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:
- amd64
- arm64
- s390x
- arm/v7
- 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: amd64
architecture: windows/amd64
image: eclipse-temurin
tag: '{{source "jdk17LastVersion" }}-jdk-windowsservercore-1809'

targets:
setJDK17VersionDockerBake:
Expand Down
51 changes: 28 additions & 23 deletions updatecli/updatecli.d/jdk21.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,56 +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: 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:
- amd64
- arm64
- s390x
- arm/v7
- 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: amd64
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*)?$"

0 comments on commit ca5e349

Please sign in to comment.