diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 5919cac8..b21cfe25 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -26,3 +26,7 @@ updates: schedule: # Check for updates to GitHub Actions every week interval: "weekly" + labels: + - github-action + - dependencies + - skip-changelog diff --git a/.github/workflows/updatecli.yaml b/.github/workflows/updatecli.yaml index 88ea76db..06d2c9b0 100644 --- a/.github/workflows/updatecli.yaml +++ b/.github/workflows/updatecli.yaml @@ -15,7 +15,7 @@ jobs: uses: actions/checkout@v4 - name: Install Updatecli in the runner - uses: updatecli/updatecli-action@v2.48.0 + uses: updatecli/updatecli-action@v2.50.0 - name: Run Updatecli in Dry Run mode run: updatecli diff --config ./updatecli/updatecli.d --values ./updatecli/values.github-action.yaml diff --git a/Makefile b/Makefile index ea908249..61d23035 100644 --- a/Makefile +++ b/Makefile @@ -51,9 +51,7 @@ list: check-reqs @set -x; make --silent show | jq -r '.target | path(.. | select(.platforms[] | contains("linux/$(ARCH)"))?) | add' bats: - git clone https://github.com/bats-core/bats-core bats ;\ - cd bats ;\ - git checkout v1.7.0 + git clone --branch v1.10.0 https://github.com/bats-core/bats-core bats prepare-test: bats check-reqs git submodule update --init --recursive @@ -79,10 +77,7 @@ test-%: prepare-test @make --silent build-$* # Execute the test harness and write result to a TAP file set -x - IMAGE=$* bats/bin/bats $(bats_flags) | tee target/results-$*.tap -# convert TAP to JUNIT - docker run --rm -v "$(CURDIR)":/usr/src/app -w /usr/src/app node:18.18.0-alpine3.18 \ - sh -c "npm install -g npm@9.9.0 && npm install tap-xunit -g && cat target/results-$*.tap | tap-xunit --package='jenkinsci.docker.$*' > target/junit-results-$*.xml" + IMAGE=$* bats/bin/bats --formatter junit $(bats_flags) | tee target/junit-results-$*.xml test: prepare-test @make --silent list | while read image; do make --silent "test-$${image}"; done diff --git a/README.md b/README.md index 88847609..f70dce0f 100644 --- a/README.md +++ b/README.md @@ -123,7 +123,7 @@ make build-_ That would give for JDK 11 on Alpine Linux: ```bash -make test-alpine_jdk11 +make build-alpine_jdk11 ``` #### Building all images diff --git a/alpine/21/Dockerfile b/alpine/21/Dockerfile deleted file mode 100644 index b45a9109..00000000 --- a/alpine/21/Dockerfile +++ /dev/null @@ -1,120 +0,0 @@ -# MIT License -# -# Copyright (c) 2019-2022 Fabio Kruger and other contributors -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# 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 ALPINE_TAG=3.18.3 -FROM alpine:"${ALPINE_TAG}" AS jre-build -ARG JAVA_VERSION=21+35 - -RUN apk add --no-cache curl jq \ - && ARCH=$(uname -m | sed 's/x86_64/x64/') \ - && JAVA_VERSION_ENCODED=$(printf '%s' "$JAVA_VERSION" | jq -jRr '@uri') \ - && BUILD_NUMBER=$(printf '%s' "$JAVA_VERSION" | cut -d'+' -f2) \ - && JAVA_MAJOR_VERSION=$(printf '%s' "$JAVA_VERSION" | cut -d'+' -f1) \ - && curl -sL https://github.com/adoptium/temurin"${JAVA_MAJOR_VERSION}"-binaries/releases/download/jdk-"${JAVA_VERSION_ENCODED}"-ea-beta/OpenJDK"${JAVA_MAJOR_VERSION}"U-jdk_"${ARCH}"_alpine-linux_hotspot_ea_"${JAVA_MAJOR_VERSION}"-0-"${BUILD_NUMBER}".tar.gz | tar xz -C /opt/ - -ENV PATH=/opt/jdk-${JAVA_VERSION}/bin:$PATH - -RUN if [ "$TARGETPLATFORM" != 'linux/arm/v7' ]; then \ - case "$(jlink --version 2>&1)" in \ - # jlink version 11 has less features than JDK17+ - "11."*) strip_java_debug_flags="--strip-debug" ;; \ - *) strip_java_debug_flags="--strip-java-debug-attributes" ;; \ - esac; \ - jlink \ - --add-modules ALL-MODULE-PATH \ - "$strip_java_debug_flags" \ - --no-man-pages \ - --no-header-files \ - --compress=2 \ - --output /javaruntime; \ - else \ - cp -r /opt/java/openjdk /javaruntime; \ - fi - -FROM alpine:"${ALPINE_TAG}" AS build - -ARG user=jenkins -ARG group=jenkins -ARG uid=1000 -ARG gid=1000 -ARG JENKINS_AGENT_HOME=/home/${user} - -ENV JENKINS_AGENT_HOME=${JENKINS_AGENT_HOME} - -ARG AGENT_WORKDIR="${JENKINS_AGENT_HOME}"/agent -# Persist agent workdir path through an environment variable for people extending the image -ENV AGENT_WORKDIR=${AGENT_WORKDIR} - -RUN addgroup -g "${gid}" "${group}" \ - # Set the home directory (h), set user and group id (u, G), set the shell, don't ask for password (D) - && adduser -h "${JENKINS_AGENT_HOME}" -u "${uid}" -G "${group}" -s /bin/bash -D "${user}" \ - # Unblock user - && passwd -u "${user}" \ - # Prepare subdirectories - && mkdir -p "${JENKINS_AGENT_HOME}/.ssh/" "${JENKINS_AGENT_HOME}/.jenkins/" "${AGENT_WORKDIR}" \ - && chown -R "${uid}":"${gid}" "${JENKINS_AGENT_HOME}" "${AGENT_WORKDIR}" - - -RUN apk add --no-cache \ - bash \ - git-lfs \ - less \ - musl-locales \ - netcat-openbsd \ - openssh \ - patch - -# setup SSH server -RUN sed -i /etc/ssh/sshd_config \ - -e 's/#PermitRootLogin.*/PermitRootLogin no/' \ - -e 's/#PasswordAuthentication.*/PasswordAuthentication no/' \ - -e 's/#SyslogFacility.*/SyslogFacility AUTH/' \ - -e 's/#LogLevel.*/LogLevel INFO/' \ - -e 's/#PermitUserEnvironment.*/PermitUserEnvironment yes/' \ - && mkdir /var/run/sshd - -# Install JDK - -ENV JAVA_HOME=/opt/java/openjdk -COPY --from=jre-build /javaruntime "$JAVA_HOME" -ENV PATH="${JAVA_HOME}/bin:${PATH}" - -# VOLUME directive must happen after setting up permissions and content -VOLUME "${AGENT_WORKDIR}" "${JENKINS_AGENT_HOME}"/.jenkins "/tmp" "/run" "/var/run" -WORKDIR "${JENKINS_AGENT_HOME}" - -# Alpine's ssh doesn't use $PATH defined in /etc/environment, so we define `$PATH` in `~/.ssh/environment` -# The file path has been created earlier in the file by `mkdir -p` and we also have configured sshd so that it will -# allow environment variables to be sourced (see `sed` command related to `PermitUserEnvironment`) -RUN echo "PATH=${PATH}" >> ${JENKINS_AGENT_HOME}/.ssh/environment -COPY setup-sshd /usr/local/bin/setup-sshd - -EXPOSE 22 - -ENTRYPOINT ["setup-sshd"] - -LABEL \ - org.opencontainers.image.vendor="Jenkins project" \ - org.opencontainers.image.title="Official Jenkins SSH Agent Docker image" \ - org.opencontainers.image.description="A Jenkins agent image which allows using SSH to establish the connection" \ - org.opencontainers.image.url="https://www.jenkins.io/" \ - org.opencontainers.image.source="https://github.com/jenkinsci/docker-ssh-agent" \ - org.opencontainers.image.licenses="MIT" diff --git a/alpine/Dockerfile b/alpine/Dockerfile index c2060355..ea7e3e54 100644 --- a/alpine/Dockerfile +++ b/alpine/Dockerfile @@ -21,7 +21,7 @@ # SOFTWARE. ARG JAVA_VERSION=17.0.8.1_1 -ARG ALPINE_TAG=3.18.4 +ARG ALPINE_TAG=3.19.0 FROM eclipse-temurin:"${JAVA_VERSION}"-jdk-alpine AS jre-build RUN if [ "$TARGETPLATFORM" != 'linux/arm/v7' ]; then \ diff --git a/debian/Dockerfile b/debian/Dockerfile index 2c5c52a2..3afd89da 100644 --- a/debian/Dockerfile +++ b/debian/Dockerfile @@ -1,6 +1,6 @@ ARG JAVA_VERSION=17.0.8.1_1 -ARG DEBIAN_RELEASE=bookworm-20231009 -FROM eclipse-temurin:"${JAVA_VERSION}"-jdk-focal AS jre-build +ARG DEBIAN_RELEASE=bookworm-20231120 +FROM eclipse-temurin:"${JAVA_VERSION}"-jdk-jammy AS jre-build # This Build ARG is populated by Docker # Ref. https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope diff --git a/debian/21/Dockerfile b/debian/preview/Dockerfile similarity index 95% rename from debian/21/Dockerfile rename to debian/preview/Dockerfile index 30abd792..c4c677a5 100644 --- a/debian/21/Dockerfile +++ b/debian/preview/Dockerfile @@ -1,6 +1,6 @@ ARG DEBIAN_RELEASE=bookworm-20230904 FROM debian:"${DEBIAN_RELEASE}" AS jre-build -ARG JAVA_VERSION=21+35 +ARG JAVA_VERSION=21.0.1+12 # This Build ARG is populated by Docker # Ref. https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope ARG TARGETPLATFORM @@ -12,8 +12,9 @@ RUN apt-get update \ && ARCH=$(uname -m | sed -e 's/x86_64/x64/' -e 's/armv7l/arm/') \ && JAVA_VERSION_ENCODED=$(printf '%s' "$JAVA_VERSION" | jq -jRr '@uri') \ && BUILD_NUMBER=$(printf '%s' "$JAVA_VERSION" | cut -d'+' -f2) \ - && JAVA_MAJOR_VERSION=$(printf '%s' "$JAVA_VERSION" | cut -d'+' -f1) \ - && curl -sL https://github.com/adoptium/temurin"${JAVA_MAJOR_VERSION}"-binaries/releases/download/jdk-"${JAVA_VERSION_ENCODED}"-ea-beta/OpenJDK"${JAVA_MAJOR_VERSION}"U-jdk_"${ARCH}"_linux_hotspot_ea_"${JAVA_MAJOR_VERSION}"-0-"${BUILD_NUMBER}".tar.gz | tar xz -C /opt/ \ + && JAVA_MAJOR_VERSION=$(printf '%s' "$JAVA_VERSION" | cut -d'.' -f1) \ + && JAVA_VERSION_KEBAB=$(printf '%s' "$JAVA_VERSION" | sed 's/+/-/g;s/\./-/g') \ + && curl -sL https://github.com/adoptium/temurin"${JAVA_MAJOR_VERSION}"-binaries/releases/download/jdk-"${JAVA_VERSION_ENCODED}"-ea-beta/OpenJDK"${JAVA_MAJOR_VERSION}"U-jdk_"${ARCH}"_linux_hotspot_ea_"${JAVA_VERSION_KEBAB}".tar.gz | tar xz -C /opt/ \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* diff --git a/docker-bake.hcl b/docker-bake.hcl index b5b556d3..bebc95c4 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -5,6 +5,7 @@ group "linux" { "alpine_jdk21", "debian_jdk11", "debian_jdk21", + "debian_jdk21-preview", ] } @@ -19,14 +20,14 @@ group "linux-arm64" { group "linux-arm32" { targets = [ - "debian_jdk21", + "debian_jdk21-preview", ] } group "linux-s390x" { targets = [ "debian_jdk11", - "debian_jdk21" + "debian_jdk21-preview" ] } @@ -55,7 +56,7 @@ variable "VERSION" { } variable "ALPINE_FULL_TAG" { - default = "3.18.4" + default = "3.19.0" } variable "ALPINE_SHORT_TAG" { @@ -71,11 +72,15 @@ variable "JAVA17_VERSION" { } variable "JAVA21_VERSION" { - default = "21+35" + default = "21.0.1_12" +} + +variable "JAVA21_PREVIEW_VERSION" { + default = "21.0.1+12" } variable "DEBIAN_RELEASE" { - default = "bookworm-20231009" + default = "bookworm-20231120" } target "alpine_jdk11" { @@ -118,19 +123,19 @@ target "alpine_jdk17" { } target "alpine_jdk21" { - dockerfile = "alpine/21/Dockerfile" + dockerfile = "alpine/Dockerfile" context = "." args = { ALPINE_TAG = ALPINE_FULL_TAG JAVA_VERSION = JAVA21_VERSION } tags = [ - equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${VERSION}-alpine-jdk21-preview" : "", - equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${VERSION}-alpine${ALPINE_SHORT_TAG}-jdk21-preview" : "", - "${REGISTRY}/${JENKINS_REPO}:alpine-jdk21-preview", - "${REGISTRY}/${JENKINS_REPO}:latest-alpine-jdk21-preview", - "${REGISTRY}/${JENKINS_REPO}:alpine${ALPINE_SHORT_TAG}-jdk21-preview", - "${REGISTRY}/${JENKINS_REPO}:latest-alpine${ALPINE_SHORT_TAG}-jdk21-preview", + equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${VERSION}-alpine-jdk21" : "", + equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${VERSION}-alpine${ALPINE_SHORT_TAG}-jdk21" : "", + "${REGISTRY}/${JENKINS_REPO}:alpine-jdk21", + "${REGISTRY}/${JENKINS_REPO}:latest-alpine-jdk21", + "${REGISTRY}/${JENKINS_REPO}:alpine${ALPINE_SHORT_TAG}-jdk21", + "${REGISTRY}/${JENKINS_REPO}:latest-alpine${ALPINE_SHORT_TAG}-jdk21", ] platforms = ["linux/amd64", "linux/arm64"] } @@ -176,12 +181,31 @@ target "debian_jdk17" { } target "debian_jdk21" { - dockerfile = "debian/21/Dockerfile" + dockerfile = "debian/Dockerfile" context = "." args = { JAVA_VERSION = JAVA21_VERSION DEBIAN_RELEASE = DEBIAN_RELEASE } + tags = [ + equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${VERSION}-jdk21" : "", + "${REGISTRY}/${JENKINS_REPO}:bookworm-jdk21", + "${REGISTRY}/${JENKINS_REPO}:debian-jdk21", + "${REGISTRY}/${JENKINS_REPO}:jdk21", + "${REGISTRY}/${JENKINS_REPO}:latest-bookworm-jdk21", + "${REGISTRY}/${JENKINS_REPO}:latest-debian-jdk21", + "${REGISTRY}/${JENKINS_REPO}:latest-jdk21", + ] + platforms = ["linux/amd64", "linux/arm64", "linux/ppc64le"] +} + +target "debian_jdk21-preview" { + dockerfile = "debian/preview/Dockerfile" + context = "." + args = { + JAVA_VERSION = JAVA21_PREVIEW_VERSION + DEBIAN_RELEASE = DEBIAN_RELEASE + } tags = [ equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${VERSION}-jdk21-preview" : "", "${REGISTRY}/${JENKINS_REPO}:bookworm-jdk21-preview", @@ -191,5 +215,5 @@ target "debian_jdk21" { "${REGISTRY}/${JENKINS_REPO}:latest-debian-jdk21-preview", "${REGISTRY}/${JENKINS_REPO}:latest-jdk21-preview", ] - platforms = ["linux/amd64", "linux/arm64", "linux/ppc64le", "linux/s390x", "linux/arm/v7"] + platforms = ["linux/s390x", "linux/arm/v7"] } diff --git a/updatecli/scripts/check-jdk.sh b/updatecli/scripts/check-jdk.sh index e941cf14..9d815a79 100755 --- a/updatecli/scripts/check-jdk.sh +++ b/updatecli/scripts/check-jdk.sh @@ -30,10 +30,11 @@ function get_jdk_download_url() { echo "https://github.com/adoptium/temurin19-binaries/releases/download/jdk-${jdk_version}/OpenJDK19U-jdk_${platform}_hotspot_${jdk_version//+/_}"; return 0;; 21*) - # JDK version (21+35-ea-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 + # 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_21-0-$(echo ${jdk_version} | cut -d '+' -f 2 | cut -d '-' -f 1)" + 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')" return 0;; *) echo "ERROR: unsupported JDK version (${jdk_version})."; diff --git a/updatecli/updatecli.d/bats.yaml b/updatecli/updatecli.d/bats.yaml new file mode 100644 index 00000000..a6df5870 --- /dev/null +++ b/updatecli/updatecli.d/bats.yaml @@ -0,0 +1,47 @@ +--- +name: Bump `bats` 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: + lastVersion: + kind: githubrelease + spec: + owner: bats-core + repository: bats-core + token: "{{ requiredEnv .github.token }}" + username: "{{ .github.username }}" + versionfilter: + kind: semver + +targets: + updateMakefile: + name: "Updates `bats` version in the Makefile" + kind: file + spec: + file: Makefile + matchpattern: >- + git clone --branch (.*) https://github.com/bats-core/bats-core bats + replacepattern: >- + git clone --branch {{ source "lastVersion" }} https://github.com/bats-core/bats-core bats + scmid: default + +actions: + default: + kind: github/pullrequest + scmid: default + title: 'chore(tests): Bump `bats` version to {{ source "lastVersion" }}' + spec: + labels: + - chore # Because bats is only used for testing + - bats diff --git a/updatecli/updatecli.d/jdk11.yaml b/updatecli/updatecli.d/jdk11.yaml index 7dd6343f..2ff968b3 100644 --- a/updatecli/updatecli.d/jdk11.yaml +++ b/updatecli/updatecli.d/jdk11.yaml @@ -44,7 +44,7 @@ conditions: tag: '{{source "jdk11LastVersion" }}-jdk-alpine' checkTemurinJDK11DebianDockerImages: kind: dockerimage - name: Check if the container image "eclipse-temurin:-jdk-focal" is available + name: Check if the container image "eclipse-temurin:-jdk-jammy" is available disablesourceinput: true spec: architectures: @@ -53,7 +53,7 @@ conditions: - s390x - arm/v7 image: eclipse-temurin - tag: '{{source "jdk11LastVersion" }}-jdk-focal' + tag: '{{source "jdk11LastVersion" }}-jdk-jammy' checkTemurinJDK11WindowsCoreDockerImage: kind: dockerimage name: Check if the container image "eclipse-temurin:-jdk-windowsservercore-1809" is available diff --git a/updatecli/updatecli.d/jdk17.yaml b/updatecli/updatecli.d/jdk17.yaml index 6e2df0c8..ee3ef991 100644 --- a/updatecli/updatecli.d/jdk17.yaml +++ b/updatecli/updatecli.d/jdk17.yaml @@ -44,7 +44,7 @@ conditions: tag: '{{source "jdk17LastVersion" }}-jdk-alpine' checkTemurinJDK17DebianDockerImages: kind: dockerimage - name: Check if the container image "eclipse-temurin:-jdk-focal" is available + name: Check if the container image "eclipse-temurin:-jdk-jammy" is available disablesourceinput: true spec: architectures: @@ -53,7 +53,7 @@ conditions: - s390x - arm/v7 image: eclipse-temurin - tag: '{{source "jdk17LastVersion" }}-jdk-focal' + tag: '{{source "jdk17LastVersion" }}-jdk-jammy' checkTemurinJDK17WindowsCoreDockerImage: kind: dockerimage name: Check if the container image "eclipse-temurin:-jdk-windowsservercore-1809" is available diff --git a/updatecli/updatecli.d/jdk21-preview.yaml b/updatecli/updatecli.d/jdk21-preview.yaml new file mode 100644 index 00000000..fe0df376 --- /dev/null +++ b/updatecli/updatecli.d/jdk21-preview.yaml @@ -0,0 +1,67 @@ +--- +name: Bump JDK21 EA version for all Linux images + +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 }}" + temurin21-binaries: + kind: "github" + spec: + user: "{{ .github.user }}" + email: "{{ .github.email }}" + owner: "adoptium" + repository: "temurin21-binaries" + token: '{{ requiredEnv .github.token }}' + branch: "main" + +sources: + getLatestJDK21EAVersion: + name: Get the latest Adoptium JDK21 EA version + kind: gittag + scmid: temurin21-binaries + spec: + versionfilter: + kind: regex + pattern: ".*-ea-.*" + transformers: + - trimprefix: "jdk-" + - trimsuffix: "-ea-beta" + +conditions: + checkIfReleaseIsAvailable: + kind: shell + spec: + command: bash ./updatecli/scripts/check-jdk.sh # source input value passed as argument + +targets: + setJDK21VersionForBake: + name: "Bump JDK21 EA version for Linux images in the docker-bake.hcl file" + kind: hcl + spec: + file: docker-bake.hcl + path: variable.JAVA21_PREVIEW_VERSION.default + scmid: default + setJDK21VersionDebian: + name: "Bump JDK21 EA version for Linux images in the Debian Dockerfile" + kind: dockerfile + spec: + file: debian/preview/Dockerfile + instruction: + keyword: "ARG" + matcher: "JAVA_VERSION" +actions: + default: + kind: github/pullrequest + scmid: default + title: Bump JDK21 EA version to {{ source "getLatestJDK21EAVersion" }} + spec: + labels: + - dependencies \ No newline at end of file diff --git a/updatecli/updatecli.d/jdk21.yaml b/updatecli/updatecli.d/jdk21.yaml index 4a7cb402..23c61f21 100644 --- a/updatecli/updatecli.d/jdk21.yaml +++ b/updatecli/updatecli.d/jdk21.yaml @@ -1,5 +1,5 @@ --- -name: Bump JDK21 version for all Linux images +name: Bump Temurin's JDK21 version scms: default: @@ -12,64 +12,93 @@ 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: - getLatestJDK21EAVersion: - name: Get the latest Adoptium JDK21 version - kind: gittag - scmid: temurin21-binaries + jdk21LastVersion: + kind: githubrelease + name: Get the latest Temurin JDK21 version spec: + owner: "adoptium" + repository: "temurin21-binaries" + token: "{{ requiredEnv .github.token }}" + username: "{{ .github.username }}" versionfilter: kind: regex - pattern: ".*-ea-.*" + # 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*)$" transformers: - trimprefix: "jdk-" - - trimsuffix: "-ea-beta" + - replacer: + from: + + to: _ conditions: - checkIfReleaseIsAvailable: - kind: shell + checkTemurinJDK21AlpineDockerImage: + kind: dockerimage + name: Check if the container image "eclipse-temurin:-jdk-alpine" is available + disablesourceinput: true + spec: + architecture: amd64 + 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 + spec: + architectures: + - amd64 + - arm64 + - s390x + - arm/v7 + 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 spec: - command: bash ./updatecli/scripts/check-jdk.sh # source input value passed as argument + architecture: amd64 + image: eclipse-temurin + tag: '{{source "jdk21LastVersion" }}-jdk-windowsservercore-1809' targets: - setJDK21VersionForBake: + setJDK21VersionDockerBake: name: "Bump JDK21 version for Linux images in the docker-bake.hcl file" kind: hcl + sourceid: jdk21LastVersion spec: file: docker-bake.hcl path: variable.JAVA21_VERSION.default scmid: default setJDK21VersionAlpine: - name: "Bump JDK21 version for Linux images in the Alpine Linux Dockerfile" + name: "Bump JDK21 default ARG version on Alpine Dockerfile" kind: dockerfile + sourceid: jdk21LastVersion spec: - file: alpine/21/Dockerfile + file: alpine/Dockerfile instruction: - keyword: "ARG" - matcher: "JAVA_VERSION" + keyword: ARG + matcher: JAVA_VERSION + scmid: default setJDK21VersionDebian: - name: "Bump JDK21 version for Linux images in the Debian Dockerfile" + name: "Bump JDK21 default ARG version on Debian Dockerfile" kind: dockerfile + sourceid: jdk21LastVersion spec: - file: debian/21/Dockerfile + file: debian/Dockerfile instruction: - keyword: "ARG" - matcher: "JAVA_VERSION" + keyword: ARG + matcher: JAVA_VERSION + scmid: default + actions: default: kind: github/pullrequest scmid: default - title: Bump JDK21 version to {{ source "getLatestJDK21EAVersion" }} + title: Bump JDK21 version to {{ source "jdk21LastVersion" }} spec: labels: - - dependencies \ No newline at end of file + - dependencies + - jdk21 diff --git a/updatecli/updatecli.d/node.yaml b/updatecli/updatecli.d/node.yaml deleted file mode 100644 index a5dd4dde..00000000 --- a/updatecli/updatecli.d/node.yaml +++ /dev/null @@ -1,80 +0,0 @@ ---- -name: Bumps the node docker images 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: - nodeLatestVersion: - kind: githubrelease - spec: - owner: "nodejs" - repository: "node" - token: "{{ requiredEnv .github.token }}" - username: "{{ .github.username }}" - transformers: - - trimprefix: "v" - alpineLatestVersion: - kind: githubrelease - name: "Get the latest Alpine Linux version" - spec: - owner: "alpinelinux" - repository: "aports" # Its release process follows Alpine's - token: "{{ requiredEnv .github.token }}" - username: "{{ .github.username }}" - versionfilter: - kind: semver - pattern: "~3" - transformers: - - findsubmatch: - pattern: >- - v(.*)(\.\d+) - captureindex: 1 - -conditions: - testNodeArg: - name: "Does the Makefile have a reference to the Node alpine image?" - kind: file - disablesourceinput: true - spec: - file: Makefile - matchpattern: >- - .*docker.*run.*node:.* - testNodeAlpineImagePublished: - name: "Test node:-alpine docker image tag" - kind: dockerimage - disablesourceinput: true - spec: - image: "node" - tag: '{{ source "nodeLatestVersion" }}-alpine{{ source "alpineLatestVersion" }}' - -targets: - updateMakefile: - name: "Updates the value of the node docker image in the Makefile" - kind: file - sourceid: nodeLatestVersion - spec: - file: Makefile - matchpattern: >- - (.*docker.*run.*)node:.*( .*) - replacepattern: >- - ${1}node:{{ source "nodeLatestVersion" }}-alpine{{ source "alpineLatestVersion" }}${2} - scmid: default - -actions: - default: - kind: github/pullrequest - scmid: default - title: Bump node alpine docker image version to {{ source "nodeLatestVersion" }}-alpine{{ source "alpineLatestVersion" }} - spec: - labels: - - chore # Because Node is only used for testing diff --git a/updatecli/updatecli.d/npm.yaml b/updatecli/updatecli.d/npm.yaml deleted file mode 100644 index 4c8533ca..00000000 --- a/updatecli/updatecli.d/npm.yaml +++ /dev/null @@ -1,61 +0,0 @@ ---- -name: Bumps the npm 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: - npmLatestVersion: - kind: githubrelease - spec: - owner: "npm" - repository: "cli" - token: "{{ requiredEnv .github.token }}" - username: "{{ .github.username }}" - versionfilter: - kind: regex - pattern: >- - ^v\d+\.\d+.\d+$ - transformers: - - trimprefix: "v" - -conditions: - testNodeArg: - name: "Does the Makefile have a reference to npm?" - kind: file - disablesourceinput: true - spec: - file: Makefile - matchpattern: >- - .*npm.* install.*-g.*npm@.*.*npm.*install.* - -targets: - updateMakefile: - name: "Updates the value of the npm version in the Makefile" - kind: file - sourceid: npmLatestVersion - spec: - file: Makefile - matchpattern: >- - (.*sh -c "npm install -g npm@)(.*)( && npm install)(.*) - replacepattern: >- - ${1}{{ source "npmLatestVersion" }}${3}${{4}} - scmid: default - -actions: - default: - kind: github/pullrequest - scmid: default - title: 'chore(tests): Bump NPM version to {{ source "npmLatestVersion" }}' - spec: - labels: - - chore # Because NPM is only used for testing diff --git a/windows/nanoserver-ltsc2019/Dockerfile b/windows/nanoserver-ltsc2019/Dockerfile index d902b2b7..32de39b0 100644 --- a/windows/nanoserver-ltsc2019/Dockerfile +++ b/windows/nanoserver-ltsc2019/Dockerfile @@ -39,8 +39,8 @@ COPY --from=jdk-core $JAVA_HOME $JAVA_HOME RUN $javaMajorVersion = $env:JAVA_HOME.Substring($env:JAVA_HOME.Length - 2); ` New-Item -Path "C:\jdk-${javaMajorVersion}" -ItemType SymbolicLink -Value "${env:JAVA_HOME}" -ARG GIT_VERSION=2.42.0 -ARG GIT_PATCH_VERSION=2 +ARG GIT_VERSION=2.43.0 +ARG GIT_PATCH_VERSION=1 RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; ` # The patch "windows.1" always have a different URL than the subsequent patch (ZIP filename is different) if($env:GIT_PATCH_VERSION -eq 1) { $url = $('https://github.com/git-for-windows/git/releases/download/v{0}.windows.{1}/MinGit-{0}-64-bit.zip' -f $env:GIT_VERSION, $env:GIT_PATCH_VERSION); } ` diff --git a/windows/windowsservercore-ltsc2019/Dockerfile b/windows/windowsservercore-ltsc2019/Dockerfile index c647c314..9c69b373 100644 --- a/windows/windowsservercore-ltsc2019/Dockerfile +++ b/windows/windowsservercore-ltsc2019/Dockerfile @@ -37,8 +37,8 @@ ENV JENKINS_AGENT_WORK ${JENKINS_AGENT_WORK} USER ContainerAdministrator # install git -ARG GIT_VERSION=2.42.0 -ARG GIT_PATCH_VERSION=2 +ARG GIT_VERSION=2.43.0 +ARG GIT_PATCH_VERSION=1 RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; ` # The patch "windows.1" always have a different URL than the subsequent patch (ZIP filename is different) if($env:GIT_PATCH_VERSION -eq 1) { $url = $('https://github.com/git-for-windows/git/releases/download/v{0}.windows.{1}/MinGit-{0}-64-bit.zip' -f $env:GIT_VERSION, $env:GIT_PATCH_VERSION); } `