From 565f979ec8ecf07b2fccf9f633750dd2f840c44e Mon Sep 17 00:00:00 2001 From: dreis2211 Date: Fri, 16 Jul 2021 13:52:57 +0200 Subject: [PATCH] Add CI pipeline for JDK 17 See gh-26767 --- ci/images/ci-image-jdk17/Dockerfile | 12 ++++++ ci/images/get-jdk-url.sh | 3 ++ ci/pipeline.yml | 64 ++++++++++++++++++++++++++++- ci/scripts/detect-jdk-updates.sh | 4 ++ 4 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 ci/images/ci-image-jdk17/Dockerfile diff --git a/ci/images/ci-image-jdk17/Dockerfile b/ci/images/ci-image-jdk17/Dockerfile new file mode 100644 index 000000000000..42e651382eda --- /dev/null +++ b/ci/images/ci-image-jdk17/Dockerfile @@ -0,0 +1,12 @@ +FROM ubuntu:focal-20210713 + +ADD setup.sh /setup.sh +ADD get-jdk-url.sh /get-jdk-url.sh +ADD get-docker-url.sh /get-docker-url.sh +RUN ./setup.sh java8 java17 + +ENV JAVA_HOME /opt/openjdk +ENV PATH $JAVA_HOME/bin:$PATH +ADD docker-lib.sh /docker-lib.sh + +ENTRYPOINT [ "switch", "shell=/bin/bash", "--", "codep", "/bin/docker daemon" ] diff --git a/ci/images/get-jdk-url.sh b/ci/images/get-jdk-url.sh index 91d2dc9912a6..29a1abf844d2 100755 --- a/ci/images/get-jdk-url.sh +++ b/ci/images/get-jdk-url.sh @@ -11,6 +11,9 @@ case "$1" in java16) echo "https://github.com/AdoptOpenJDK/openjdk16-binaries/releases/download/jdk-16.0.1%2B9/OpenJDK16U-jdk_x64_linux_hotspot_16.0.1_9.tar.gz" ;; + java17) + echo "https://github.com/AdoptOpenJDK/openjdk17-binaries/releases/download/jdk-2021-05-07-13-31/OpenJDK-jdk_x64_linux_hotspot_2021-05-06-23-30.tar.gz" + ;; *) echo $"Unknown java version" exit 1 diff --git a/ci/pipeline.yml b/ci/pipeline.yml index 1379000a3f71..70bebf1aae86 100644 --- a/ci/pipeline.yml +++ b/ci/pipeline.yml @@ -165,6 +165,12 @@ resources: source: <<: *registry-image-resource-source repository: ((docker-hub-organization))/spring-boot-ci-jdk16 +- name: ci-image-jdk17 + type: registry-image + icon: docker + source: + <<: *registry-image-resource-source + repository: ((docker-hub-organization))/spring-boot-ci-jdk17 - name: artifactory-repo type: artifactory-resource icon: package-variant @@ -197,6 +203,14 @@ resources: access_token: ((github-ci-status-token)) branch: ((branch)) context: jdk16-build +- name: repo-status-jdk17-build + type: github-status-resource + icon: eye-check-outline + source: + repository: ((github-repo-name)) + access_token: ((github-ci-status-token)) + branch: ((branch)) + context: jdk17-build - name: slack-alert type: slack-notification icon: slack @@ -246,6 +260,13 @@ jobs: image: ci-image-jdk16 vars: ci-image-name: ci-image-jdk16 + - task: build-ci-image-jdk17 + privileged: true + file: git-repo/ci/tasks/build-ci-image.yml + output_mapping: + image: ci-image-jdk17 + vars: + ci-image-name: ci-image-jdk17 - in_parallel: - put: ci-image params: @@ -256,6 +277,9 @@ jobs: - put: ci-image-jdk16 params: image: ci-image-jdk16/image.tar + - put: ci-image-jdk17 + params: + image: ci-image-jdk17/image.tar - name: detect-jdk-updates plan: - get: git-repo @@ -281,6 +305,12 @@ jobs: params: <<: *github-task-params JDK_VERSION: java16 + - task: detect-jdk17-update + image: ci-image + file: git-repo/ci/tasks/detect-jdk-updates.yml + params: + <<: *github-task-params + JDK_VERSION: java17 - name: detect-ubuntu-image-updates plan: - get: git-repo @@ -425,6 +455,38 @@ jobs: - put: slack-alert params: <<: *slack-success-params +- name: jdk17-build + serial: true + public: true + plan: + - get: ci-image-jdk17 + - get: git-repo + trigger: true + - put: repo-status-jdk17-build + params: { state: "pending", commit: "git-repo" } + - do: + - task: build-project + image: ci-image-jdk17 + privileged: true + timeout: ((task-timeout)) + file: git-repo/ci/tasks/build-project.yml + params: + BRANCH: ((branch)) + TOOLCHAIN_JAVA_VERSION: 17 + <<: *gradle-enterprise-task-params + <<: *docker-hub-task-params + on_failure: + do: + - put: repo-status-jdk17-build + params: { state: "failure", commit: "git-repo" } + - put: slack-alert + params: + <<: *slack-fail-params + - put: repo-status-jdk17-build + params: { state: "success", commit: "git-repo" } + - put: slack-alert + params: + <<: *slack-success-params - name: windows-build serial: true plan: @@ -670,7 +732,7 @@ jobs: repository: updated-homebrew-tap-repo groups: - name: "builds" - jobs: ["build", "jdk11-build", "jdk16-build", "windows-build"] + jobs: ["build", "jdk11-build", "jdk16-build", "jdk17-build", "windows-build"] - name: "releases" jobs: ["stage-milestone", "stage-rc", "stage-release", "promote-milestone", "promote-rc", "promote-release", "create-github-release", "publish-gradle-plugin", "publish-to-sdkman", "update-homebrew-tap"] - name: "ci-images" diff --git a/ci/scripts/detect-jdk-updates.sh b/ci/scripts/detect-jdk-updates.sh index e9e3bc8bc272..98e19b5fdc8a 100755 --- a/ci/scripts/detect-jdk-updates.sh +++ b/ci/scripts/detect-jdk-updates.sh @@ -20,6 +20,10 @@ case "$JDK_VERSION" in BASE_URL="https://api.adoptopenjdk.net/v3/assets/feature_releases/16/ga" ISSUE_TITLE="Upgrade Java 16 version in CI image" ;; + java17) + BASE_URL="https://api.adoptopenjdk.net/v3/assets/feature_releases/17/ea" + ISSUE_TITLE="Upgrade Java 17 version in CI image" + ;; *) echo $"Unknown java version" exit 1;