diff --git a/.github/workflows/updatecli.yaml b/.github/workflows/updatecli.yaml index 84eb56c6..5c41fabd 100644 --- a/.github/workflows/updatecli.yaml +++ b/.github/workflows/updatecli.yaml @@ -18,12 +18,12 @@ jobs: uses: updatecli/updatecli-action@v2.56.0 - 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 }} diff --git a/Makefile b/Makefile index 61d23035..a32b3445 100644 --- a/Makefile +++ b/Makefile @@ -51,7 +51,7 @@ list: check-reqs @set -x; make --silent show | jq -r '.target | path(.. | select(.platforms[] | contains("linux/$(ARCH)"))?) | add' bats: - git clone --branch v1.10.0 https://github.com/bats-core/bats-core bats + git clone --branch v1.11.0 https://github.com/bats-core/bats-core bats prepare-test: bats check-reqs git submodule update --init --recursive diff --git a/alpine/Dockerfile b/alpine/Dockerfile index 1039f698..cabaca60 100644 --- a/alpine/Dockerfile +++ b/alpine/Dockerfile @@ -20,7 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -ARG JAVA_VERSION=17.0.8.1_1 +ARG JAVA_VERSION=17.0.10_7 ARG ALPINE_TAG=3.19.1 FROM eclipse-temurin:"${JAVA_VERSION}"-jdk-alpine AS jre-build diff --git a/debian/Dockerfile b/debian/Dockerfile index 9ef11139..1385361e 100644 --- a/debian/Dockerfile +++ b/debian/Dockerfile @@ -1,4 +1,4 @@ -ARG JAVA_VERSION=17.0.8.1_1 +ARG JAVA_VERSION=17.0.10_7 ARG DEBIAN_RELEASE=bookworm-20240311 FROM eclipse-temurin:"${JAVA_VERSION}"-jdk-jammy AS jre-build diff --git a/docker-bake.hcl b/docker-bake.hcl index 33123f27..db974eee 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -4,6 +4,7 @@ group "linux" { "alpine_jdk17", "alpine_jdk21", "debian_jdk11", + "debian_jdk17", "debian_jdk21", "debian_jdk21-preview", ] @@ -64,11 +65,11 @@ variable "ALPINE_SHORT_TAG" { } variable "JAVA11_VERSION" { - default = "11.0.20.1_1" + default = "11.0.22_7" } variable "JAVA17_VERSION" { - default = "17.0.8.1_1" + default = "17.0.10_7" } variable "JAVA21_VERSION" { diff --git a/updatecli/scripts/check-jdk.sh b/updatecli/scripts/check-jdk.sh index 9d815a79..d16ac594 100755 --- a/updatecli/scripts/check-jdk.sh +++ b/updatecli/scripts/check-jdk.sh @@ -5,7 +5,7 @@ # The source of truth is the ERB template stored at the location dist/profile/templates/jenkinscontroller/casc/tools.yaml.erb # It lists all the installations used as "Jenkins Tools" by the Jenkins controllers of the infrastructure ## -set -eu # -o pipefail +set -eu -o pipefail command -v curl >/dev/null 2>&1 || { echo "ERROR: curl command not found. Exiting."; exit 1; } @@ -29,12 +29,20 @@ function get_jdk_download_url() { ## JDK19 URLs have an underscore ('_') instead of a plus ('+') in their archive names echo "https://github.com/adoptium/temurin19-binaries/releases/download/jdk-${jdk_version}/OpenJDK19U-jdk_${platform}_hotspot_${jdk_version//+/_}"; return 0;; + 21*-ea-beta) + # JDK preview version (21+35-ea-beta, 21.0.1+12-ea-beta) + # This has been updated to support the new inferred URL pattern that started as of 21.0.3+2-ea-beta. It will not work for earlier preview versions. + # One could update the cases to support all preview versions, if desired. + jdk_version="${jdk_version//-beta}" + ## https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21%2B35-ea-beta/OpenJDK21U-jdk_aarch64_linux_hotspot_ea_21-0-35.tar.gz + ## https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.1%2B12-ea-beta/OpenJDK21U-jdk_x64_linux_hotspot_ea_21-0-1-12.tar.gz + dashJDKVersion="${jdk_version//+/_}" + jdk_version="${jdk_version//-ea}" + echo "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-${jdk_version//+/%2B}-ea-beta/OpenJDK21U-jdk_${platform}_hotspot_${dashJDKVersion}" + return 0;; 21*) - # TODO: Check both generally available and early access versions, as both are in use within this repository - # JDK version (21.0.1+12-ea-beta) - ## https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21%2B35-ea-beta/OpenJDK21U-jdk_aarch64_linux_hotspot_ea_21-0-1-12.tar.gz - urlEncodedJDKVersion="${jdk_version//+/%2B}" - echo "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-${urlEncodedJDKVersion}-ea-beta/OpenJDK21U-jdk_${platform}_hotspot_ea_$(echo ${jdk_version} | sed 's/+/-/g;s/\./-/g')" + ## JDK21 URLs have an underscore ('_') instead of a plus ('+') in their archive names + echo "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-${jdk_version}/OpenJDK21U-jdk_${platform}_hotspot_${jdk_version//+/_}"; return 0;; *) echo "ERROR: unsupported JDK version (${jdk_version})."; @@ -52,8 +60,10 @@ case "${1}" in platforms=("x64_linux" "x64_windows" "aarch64_linux" "s390x_linux");; 19.*+*) platforms=("x64_linux" "x64_windows" "aarch64_linux" "s390x_linux");; - 21*+*) + 21*+*-ea-beta) platforms=("x64_linux" "x64_windows" "aarch64_linux" "s390x_linux");; + 21*+*) + platforms=("x64_linux" "x64_windows" "aarch64_linux");; *) echo "ERROR: unsupported JDK version (${1})."; exit 1;; diff --git a/updatecli/updatecli.d/jdk11.yaml b/updatecli/updatecli.d/jdk11.yaml index 36cdea79..b3c56202 100644 --- a/updatecli/updatecli.d/jdk11.yaml +++ b/updatecli/updatecli.d/jdk11.yaml @@ -16,7 +16,7 @@ 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" @@ -24,9 +24,9 @@ sources: 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: @@ -37,15 +37,16 @@ conditions: checkTemurinJDK11AlpineDockerImage: kind: dockerimage name: Check if the container image "eclipse-temurin:-jdk-alpine" is available - disablesourceinput: true + transformers: + - addsuffix: "-jdk-alpine" spec: architecture: linux/amd64 image: eclipse-temurin - tag: '{{source "jdk11LastVersion" }}-jdk-alpine' checkTemurinJDK11DebianDockerImages: kind: dockerimage name: Check if the container image "eclipse-temurin:-jdk-jammy" is available - disablesourceinput: true + transformers: + - addsuffix: "-jdk-jammy" spec: architectures: - linux/amd64 @@ -53,15 +54,14 @@ conditions: - linux/s390x - linux/arm/v7 image: eclipse-temurin - tag: '{{source "jdk11LastVersion" }}-jdk-jammy' checkTemurinJDK11WindowsCoreDockerImage: kind: dockerimage name: Check if the container image "eclipse-temurin:-jdk-windowsservercore-1809" is available - disablesourceinput: true + transformers: + - addsuffix: "-jdk-windowsservercore-1809" spec: architecture: windows/amd64 image: eclipse-temurin - tag: '{{source "jdk11LastVersion" }}-jdk-windowsservercore-1809' targets: setJDK11VersionNanoServer: diff --git a/updatecli/updatecli.d/jdk17.yaml b/updatecli/updatecli.d/jdk17.yaml index 399464c0..94a7768b 100644 --- a/updatecli/updatecli.d/jdk17.yaml +++ b/updatecli/updatecli.d/jdk17.yaml @@ -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" @@ -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: @@ -37,15 +37,16 @@ conditions: checkTemurinJDK17AlpineDockerImage: kind: dockerimage name: Check if the container image "eclipse-temurin:-jdk-alpine" is available - disablesourceinput: true + transformers: + - addsuffix: "-jdk-alpine" spec: architecture: linux/amd64 image: eclipse-temurin - tag: '{{source "jdk17LastVersion" }}-jdk-alpine' checkTemurinJDK17DebianDockerImages: kind: dockerimage - name: Check if the container image "eclipse-temurin:-jdk-jammy" is available - disablesourceinput: true + name: Check if the container image "eclipse-temurin:-jdk-focal" is available + transformers: + - addsuffix: "-jdk-focal" spec: architectures: - linux/amd64 @@ -53,15 +54,14 @@ conditions: - linux/s390x - linux/arm/v7 image: eclipse-temurin - tag: '{{source "jdk17LastVersion" }}-jdk-jammy' checkTemurinJDK17WindowsCoreDockerImage: kind: dockerimage name: Check if the container image "eclipse-temurin:-jdk-windowsservercore-1809" is available - disablesourceinput: true + transformers: + - addsuffix: "-jdk-windowsservercore-1809" spec: architecture: windows/amd64 image: eclipse-temurin - tag: '{{source "jdk17LastVersion" }}-jdk-windowsservercore-1809' targets: setJDK17VersionDockerBake: diff --git a/updatecli/updatecli.d/jdk21.yaml b/updatecli/updatecli.d/jdk21.yaml index a6fcd31d..df14767a 100644 --- a/updatecli/updatecli.d/jdk21.yaml +++ b/updatecli/updatecli.d/jdk21.yaml @@ -12,55 +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:-jdk-alpine" is available - disablesourceinput: true + transformers: + - addsuffix: "-jdk-alpine" spec: - architecture: linux/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:-jdk-jammy" is available - disablesourceinput: true + transformers: + - addsuffix: "-jdk-jammy" spec: architectures: - 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:-jdk-windowsservercore-1809" is available - disablesourceinput: true + transformers: + - addsuffix: "-jdk-windowsservercore-1809" spec: architecture: windows/amd64 image: eclipse-temurin - tag: '{{source "jdk21LastVersion" }}-jdk-windowsservercore-1809' targets: setJDK21VersionDockerBake: diff --git a/updatecli/values.temurin.yaml b/updatecli/values.temurin.yaml new file mode 100644 index 00000000..3e507197 --- /dev/null +++ b/updatecli/values.temurin.yaml @@ -0,0 +1,2 @@ +temurin: + version_pattern: "^jdk-[11|17|21].(\\d*).(\\d*).(\\d*)(.(\\d*))\\+(\\d*)?$" diff --git a/windows/nanoserver-ltsc2019/Dockerfile b/windows/nanoserver-ltsc2019/Dockerfile index 5714109e..513ce344 100644 --- a/windows/nanoserver-ltsc2019/Dockerfile +++ b/windows/nanoserver-ltsc2019/Dockerfile @@ -21,7 +21,7 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -ARG JAVA_VERSION=11.0.20.1_1 +ARG JAVA_VERSION=11.0.22_7 FROM eclipse-temurin:"${JAVA_VERSION}"-jdk-windowsservercore-1809 AS jdk-core FROM mcr.microsoft.com/powershell:nanoserver-1809 diff --git a/windows/windowsservercore-ltsc2019/Dockerfile b/windows/windowsservercore-ltsc2019/Dockerfile index 8330ec64..a99806bd 100644 --- a/windows/windowsservercore-ltsc2019/Dockerfile +++ b/windows/windowsservercore-ltsc2019/Dockerfile @@ -22,7 +22,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -ARG JAVA_VERSION=11.0.20.1_1 +ARG JAVA_VERSION=11.0.22_7 FROM eclipse-temurin:"${JAVA_VERSION}"-jdk-windowsservercore-1809 SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]