Skip to content

Commit

Permalink
Merge pull request #308 from dduportal/chore/updatecli/switch-to-hcl-…
Browse files Browse the repository at this point in the history
…resource

chore(updatecli) switch to HCL native resource + manifest fixes
  • Loading branch information
dduportal authored Sep 2, 2023
2 parents 32d17b9 + 5902825 commit 7eccdb0
Show file tree
Hide file tree
Showing 5 changed files with 116 additions and 105 deletions.
16 changes: 3 additions & 13 deletions updatecli/updatecli.d/alpine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,6 @@ conditions:
image: "alpine"
# tag come from the source
architecture: amd64
testVersionInBakeFile:
name: "Does the bake file have variable ALPINE_VERSION"
kind: file
disablesourceinput: true
spec:
file: docker-bake.hcl
matchpattern: "(.*ALPINE_FULL_TAG.*)"

targets:
updateDockerfile:
Expand All @@ -66,13 +59,10 @@ targets:
scmid: default
updateDockerBake:
name: "Update the value of the base image (ARG ALPINE_TAG) in the docker-bake.hcl"
kind: file
kind: hcl
spec:
file: docker-bake.hcl
matchpattern: >-
variable(.*)"ALPINE_FULL_TAG"(.*){(.*)(\r\n|\r|\n)(.*)default(.*)=(.*)
replacepattern: >-
variable${1}"ALPINE_FULL_TAG"${2}{${3}${4}${5}default${6}= "{{ source "latestVersion" }}"
path: variable.ALPINE_FULL_TAG.default
scmid: default
actions:
default:
Expand All @@ -81,4 +71,4 @@ actions:
title: Bump Alpine Linux Version to {{ source "latestVersion" }}
spec:
labels:
- dependencies
- dependencies
11 changes: 4 additions & 7 deletions updatecli/updatecli.d/debian.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ sources:
name: "Get the latest Debian Bookworm Linux version"
spec:
image: "debian"
tagFilter: "bookworm-*"
tagfilter: "bookworm-*"
versionfilter:
kind: regex
pattern: >-
Expand All @@ -37,15 +37,12 @@ targets:
matcher: "DEBIAN_RELEASE"
scmid: default
updateDockerBake:
name: "Update the value of the base image (ARG DEBIAN_RELEASE) in the docker-bake.hcl"
kind: file
name: "Update the default value of the variable DEBIAN_RELEASE in the docker-bake.hcl"
kind: hcl
sourceid: bookwormLatestVersion
spec:
file: docker-bake.hcl
matchpattern: >-
variable(.*)"DEBIAN_RELEASE"(.*){(.*)(\r\n|\r|\n)(.*)default(.*)=(.*)
replacepattern: >-
variable${1}"DEBIAN_RELEASE"${2}{${3}${4}${5}default${6}= "{{ source "bookwormLatestVersion" }}"
path: variable.DEBIAN_RELEASE.default
scmid: default

actions:
Expand Down
103 changes: 103 additions & 0 deletions updatecli/updatecli.d/jdk11.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
---
name: Bump Temurin's JDK11 version

scms:
default:
kind: github
spec:
user: "{{ .github.user }}"
email: "{{ .github.email }}"
owner: "{{ .github.owner }}"
repository: "{{ .github.repository }}"
token: "{{ requiredEnv .github.token }}"
username: "{{ .github.username }}"
branch: "{{ .github.branch }}"

sources:
jdk11LastVersion:
kind: githubrelease
name: Get the latest Temurin 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*)$"
transformers:
- trimprefix: "jdk-"
- replacer:
from: +
to: _

conditions:
checkTemurinJDK11AlpineDockerImage:
kind: dockerimage
name: Check if the container image "eclipse-temurin:<jdk11LastVersion>-jdk-alpine" is available
disablesourceinput: true
spec:
architecture: amd64
image: eclipse-temurin
tag: '{{source "jdk11LastVersion" }}-jdk-alpine'
checkTemurinJDK11DebianDockerImages:
kind: dockerimage
name: Check if the container image "eclipse-temurin:<jdk11LastVersion>-jdk-focal" is available
disablesourceinput: true
spec:
architectures:
- amd64
- arm64
- s390x
- arm/v7
image: eclipse-temurin
tag: '{{source "jdk11LastVersion" }}-jdk-focal'
checkTemurinJDK11WindowsCoreDockerImage:
kind: dockerimage
name: Check if the container image "eclipse-temurin:<jdk11LastVersion>-jdk-windowsservercore-1809" is available
disablesourceinput: true
spec:
architecture: amd64
image: eclipse-temurin
tag: '{{source "jdk11LastVersion" }}-jdk-windowsservercore-1809'

targets:
setJDK11VersionNanoServer:
name: "Bump JDK11 default ARG version on Windows NanoServer Dockerfile"
kind: dockerfile
sourceid: jdk11LastVersion
spec:
file: windows/nanoserver-ltsc2019/Dockerfile
instruction:
keyword: ARG
matcher: JAVA_VERSION
scmid: default
setJDK11VersionServerCore:
name: "Bump JDK11 default ARG version on Windows Server Core Dockerfile"
kind: dockerfile
sourceid: jdk11LastVersion
spec:
file: windows/windowsservercore-ltsc2019/Dockerfile
instruction:
keyword: ARG
matcher: JAVA_VERSION
scmid: default
setJDK11VersionDockerBake:
name: "Bump JDK11 version for Linux images in the docker-bake.hcl file"
kind: hcl
sourceid: jdk11LastVersion
spec:
file: docker-bake.hcl
path: variable.JAVA11_VERSION.default
scmid: default
actions:
default:
kind: github/pullrequest
scmid: default
title: Bump JDK11 version to {{ source "jdk11LastVersion" }}
spec:
labels:
- dependencies
- jdk11
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,6 @@ sources:
- replacer:
from: +
to: _
jdk11LastVersion:
kind: githubrelease
name: Get the latest Temurin JDK11 version
spec:
owner: "adoptium"
repository: "temurin11-binaries"
token: "{{ requiredEnv .github.token }}"
username: "{{ .github.username }}"
versionfilter:
kind: regex
# jdk-11.0.4.1+1(https://github.com/adoptium/temurin17-binaries/releases/tag/jdk-17.0.4.1%2B1) is OK
pattern: "^jdk-11.(\\d*).(\\d*).(\\d*)(.(\\d*))+(\\d*)$"
transformers:
- trimprefix: "jdk-"
- replacer:
from: +
to: _

conditions:
checkTemurinJDK17AlpineDockerImage:
Expand Down Expand Up @@ -79,46 +62,15 @@ conditions:
architecture: amd64
image: eclipse-temurin
tag: '{{source "jdk17LastVersion" }}-jdk-windowsservercore-1809'
checkTemurinJDK11AlpineDockerImage:
kind: dockerimage
name: Check if the container image "eclipse-temurin:<jdk11LastVersion>-jdk-alpine" is available
disablesourceinput: true
spec:
architecture: amd64
image: eclipse-temurin
tag: '{{source "jdk11LastVersion" }}-jdk-alpine'
checkTemurinJDK11DebianDockerImages:
kind: dockerimage
name: Check if the container image "eclipse-temurin:<jdk11LastVersion>-jdk-focal" is available
disablesourceinput: true
spec:
architectures:
- amd64
- arm64
- s390x
- arm/v7
image: eclipse-temurin
tag: '{{source "jdk11LastVersion" }}-jdk-focal'
checkTemurinJDK11WindowsCoreDockerImage:
kind: dockerimage
name: Check if the container image "eclipse-temurin:<jdk11LastVersion>-jdk-windowsservercore-1809" is available
disablesourceinput: true
spec:
architecture: amd64
image: eclipse-temurin
tag: '{{source "jdk11LastVersion" }}-jdk-windowsservercore-1809'


targets:
setJDK17VersionDockerBake:
name: "Bump JDK17 version for Linux images in the docker-bake.hcl file"
kind: file
kind: hcl
sourceid: jdk17LastVersion
spec:
file: docker-bake.hcl
matchpattern: >-
variable(.*)"JAVA17_VERSION"(.*){(.*)(\r\n|\r|\n)(.*)default(.*)=(.*)
replacepattern: >-
variable${1}"JAVA17_VERSION"${2}{${3}${4}${5}default${6}= "{{ source "jdk17LastVersion" }}"
path: variable.JAVA17_VERSION.default
scmid: default
setJDK17VersionAlpine:
name: "Bump JDK17 default ARG version on Alpine Dockerfile"
Expand All @@ -140,37 +92,7 @@ targets:
keyword: ARG
matcher: JAVA_VERSION
scmid: default
setJDK11VersionNanoServer:
name: "Bump JDK11 default ARG version on Windows NanoServer Dockerfile"
kind: dockerfile
sourceid: jdk11LastVersion
spec:
file: windows/nanoserver-ltsc2019/Dockerfile
instruction:
keyword: ARG
matcher: JAVA_VERSION
scmid: default
setJDK11VersionServerCore:
name: "Bump JDK11 default ARG version on Windows Server Core Dockerfile"
kind: dockerfile
sourceid: jdk11LastVersion
spec:
file: windows/windowsservercore-ltsc2019/Dockerfile
instruction:
keyword: ARG
matcher: JAVA_VERSION
scmid: default
setJDK11VersionDockerBake:
name: "Bump JDK11 version for Linux images in the docker-bake.hcl file"
kind: file
sourceid: jdk11LastVersion
spec:
file: docker-bake.hcl
matchpattern: >-
variable(.*)"JAVA11_VERSION"(.*){(.*)(\r\n|\r|\n)(.*)default(.*)=(.*)
replacepattern: >-
variable${1}"JAVA11_VERSION"${2}{${3}${4}${5}default${6}= "{{ source "jdk11LastVersion" }}"
scmid: default

actions:
default:
kind: github/pullrequest
Expand All @@ -179,4 +101,4 @@ actions:
spec:
labels:
- dependencies
- jdk17
- jdk17
3 changes: 1 addition & 2 deletions updatecli/updatecli.d/npm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,12 @@ targets:
replacepattern: >-
${1}{{ source "npmLatestVersion" }}${3}${{4}}
scmid: default


actions:
default:
kind: github/pullrequest
scmid: default
title: chore(tests): Bump NPM version to {{ source "npmLatestVersion" }}
title: 'chore(tests): Bump NPM version to {{ source "npmLatestVersion" }}'
spec:
labels:
- chore # Because NPM is only used for testing

0 comments on commit 7eccdb0

Please sign in to comment.