Add Java 14 CI

See gh-20413
pull/20559/head
dreis2211 5 years ago committed by Stephane Nicoll
parent 2e2f839bc8
commit f0e57ed688

@ -141,6 +141,7 @@ public class ConventionsPlugin implements Plugin<Project> {
}); });
project.getTasks().withType(Test.class, (test) -> { project.getTasks().withType(Test.class, (test) -> {
withOptionalBuildJavaHome(project, (javaHome) -> test.setExecutable(javaHome + "/bin/java")); withOptionalBuildJavaHome(project, (javaHome) -> test.setExecutable(javaHome + "/bin/java"));
withOptionalTestJavaHome(project, (javaHome) -> test.setExecutable(javaHome + "/bin/java"));
test.useJUnitPlatform(); test.useJUnitPlatform();
test.setMaxHeapSize("1024M"); test.setMaxHeapSize("1024M");
}); });
@ -199,7 +200,15 @@ public class ConventionsPlugin implements Plugin<Project> {
} }
private void withOptionalBuildJavaHome(Project project, Consumer<String> consumer) { private void withOptionalBuildJavaHome(Project project, Consumer<String> consumer) {
String buildJavaHome = (String) project.findProperty("buildJavaHome"); withOptionalJavaHome(project, consumer, "buildJavaHome");
}
private void withOptionalTestJavaHome(Project project, Consumer<String> consumer) {
withOptionalJavaHome(project, consumer, "testJavaHome");
}
private void withOptionalJavaHome(Project project, Consumer<String> consumer, String javaHome) {
String buildJavaHome = (String) project.findProperty(javaHome);
if (buildJavaHome != null && !buildJavaHome.isEmpty()) { if (buildJavaHome != null && !buildJavaHome.isEmpty()) {
consumer.accept(buildJavaHome); consumer.accept(buildJavaHome);
} }

@ -11,6 +11,9 @@ case "$1" in
java13) java13)
echo "https://github.com/AdoptOpenJDK/openjdk13-binaries/releases/download/jdk-13.0.2%2B8/OpenJDK13U-jdk_x64_linux_hotspot_13.0.2_8.tar.gz" echo "https://github.com/AdoptOpenJDK/openjdk13-binaries/releases/download/jdk-13.0.2%2B8/OpenJDK13U-jdk_x64_linux_hotspot_13.0.2_8.tar.gz"
;; ;;
java14)
echo "https://github.com/AdoptOpenJDK/openjdk14-binaries/releases/download/jdk14-2020-03-05-04-06/OpenJDK14-jdk_x64_linux_hotspot_2020-03-05-04-06.tar.gz"
;;
*) *)
echo $"Unknown java version" echo $"Unknown java version"
exit 1 exit 1

@ -23,6 +23,16 @@ curl -L ${JDK_URL} | tar zx --strip-components=1
test -f /opt/openjdk/bin/java test -f /opt/openjdk/bin/java
test -f /opt/openjdk/bin/javac test -f /opt/openjdk/bin/javac
if [[ $1 != $2 ]]; then
SECONDARY_JDK_URL=$( ./get-jdk-url.sh $2 )
mkdir -p /opt/openjdk-secondary
cd /opt/openjdk-secondary
curl -L ${SECONDARY_JDK_URL} | tar zx --strip-components=1
test -f /opt/openjdk-secondary/bin/java
test -f /opt/openjdk-secondary/bin/javac
fi
########################################################### ###########################################################
# DOCKER # DOCKER

@ -2,7 +2,7 @@ FROM ubuntu:bionic-20200219
ADD setup.sh /setup.sh ADD setup.sh /setup.sh
ADD get-jdk-url.sh /get-jdk-url.sh ADD get-jdk-url.sh /get-jdk-url.sh
RUN ./setup.sh java8 RUN ./setup.sh java8 java8
ENV JAVA_HOME /opt/openjdk ENV JAVA_HOME /opt/openjdk
ENV PATH $JAVA_HOME/bin:$PATH ENV PATH $JAVA_HOME/bin:$PATH

@ -2,7 +2,7 @@ FROM ubuntu:bionic-20200219
ADD setup.sh /setup.sh ADD setup.sh /setup.sh
ADD get-jdk-url.sh /get-jdk-url.sh ADD get-jdk-url.sh /get-jdk-url.sh
RUN ./setup.sh java11 RUN ./setup.sh java11 java11
ENV JAVA_HOME /opt/openjdk ENV JAVA_HOME /opt/openjdk
ENV PATH $JAVA_HOME/bin:$PATH ENV PATH $JAVA_HOME/bin:$PATH

@ -2,7 +2,7 @@ FROM ubuntu:bionic-20200219
ADD setup.sh /setup.sh ADD setup.sh /setup.sh
ADD get-jdk-url.sh /get-jdk-url.sh ADD get-jdk-url.sh /get-jdk-url.sh
RUN ./setup.sh java13 RUN ./setup.sh java13 java13
ENV JAVA_HOME /opt/openjdk ENV JAVA_HOME /opt/openjdk
ENV PATH $JAVA_HOME/bin:$PATH ENV PATH $JAVA_HOME/bin:$PATH

@ -0,0 +1,11 @@
FROM ubuntu:bionic-20200219
ADD setup.sh /setup.sh
ADD get-jdk-url.sh /get-jdk-url.sh
RUN ./setup.sh java8 java14
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" ]

@ -94,6 +94,14 @@ resources:
username: ((docker-hub-username)) username: ((docker-hub-username))
password: ((docker-hub-password)) password: ((docker-hub-password))
tag: 2.3.x tag: 2.3.x
- name: spring-boot-jdk14-ci-image
type: docker-image
icon: docker
source:
repository: ((docker-hub-organization))/spring-boot-jdk14-ci-image
username: ((docker-hub-username))
password: ((docker-hub-password))
tag: 2.3.x
- name: artifactory-repo - name: artifactory-repo
type: artifactory-resource type: artifactory-resource
icon: package-variant icon: package-variant
@ -126,6 +134,14 @@ resources:
access_token: ((github-ci-status-token)) access_token: ((github-ci-status-token))
branch: ((branch)) branch: ((branch))
context: jdk13-build context: jdk13-build
- name: repo-status-jdk14-build
type: github-status-resource
icon: eye-check-outline
source:
repository: ((github-repo-name))
access_token: ((github-ci-status-token))
branch: ((branch))
context: jdk14-build
- name: slack-alert - name: slack-alert
type: slack-notification type: slack-notification
icon: slack icon: slack
@ -160,6 +176,10 @@ jobs:
params: params:
build: ci-images-git-repo/ci/images build: ci-images-git-repo/ci/images
dockerfile: ci-images-git-repo/ci/images/spring-boot-jdk13-ci-image/Dockerfile dockerfile: ci-images-git-repo/ci/images/spring-boot-jdk13-ci-image/Dockerfile
- put: spring-boot-jdk14-ci-image
params:
build: ci-images-git-repo/ci/images
dockerfile: ci-images-git-repo/ci/images/spring-boot-jdk14-ci-image/Dockerfile
- name: detect-jdk-updates - name: detect-jdk-updates
plan: plan:
- get: git-repo - get: git-repo
@ -194,6 +214,15 @@ jobs:
GITHUB_USERNAME: ((github-username)) GITHUB_USERNAME: ((github-username))
JDK_VERSION: java13 JDK_VERSION: java13
image: spring-boot-ci-image image: spring-boot-ci-image
- task: detect-jdk14-update
file: git-repo/ci/tasks/detect-jdk-updates.yml
params:
GITHUB_REPO: spring-boot
GITHUB_ORGANIZATION: spring-projects
GITHUB_PASSWORD: ((github-password))
GITHUB_USERNAME: ((github-username))
JDK_VERSION: java14
image: spring-boot-ci-image
- name: detect-ubuntu-image-updates - name: detect-ubuntu-image-updates
plan: plan:
- get: git-repo - get: git-repo
@ -375,6 +404,44 @@ jobs:
silent: true silent: true
icon_emoji: ":concourse:" icon_emoji: ":concourse:"
username: concourse-ci username: concourse-ci
- name: jdk14-build
serial: true
public: true
plan:
- get: spring-boot-jdk14-ci-image
- get: git-repo
trigger: false
- put: repo-status-jdk14-build
params: { state: "pending", commit: "git-repo" }
- do:
- task: build-project
privileged: true
timeout: ((task-timeout))
image: spring-boot-jdk14-ci-image
file: git-repo/ci/tasks/build-project.yml
params:
BRANCH: ((branch))
GRADLE_ENTERPRISE_ACCESS_KEY: ((gradle_enterprise_secret_access_key))
GRADLE_ENTERPRISE_CACHE_USERNAME: ((gradle_enterprise_cache_user.username))
GRADLE_ENTERPRISE_CACHE_PASSWORD: ((gradle_enterprise_cache_user.password))
on_failure:
do:
- put: repo-status-jdk14-build
params: { state: "failure", commit: "git-repo" }
- put: slack-alert
params:
text: ":concourse-failed: <https://ci.spring.io/teams/${BUILD_TEAM_NAME}/pipelines/${BUILD_PIPELINE_NAME}/jobs/${BUILD_JOB_NAME}/builds/${BUILD_NAME}|${BUILD_PIPELINE_NAME} ${BUILD_JOB_NAME} failed!>"
silent: true
icon_emoji: ":concourse:"
username: concourse-ci
- put: repo-status-jdk14-build
params: { state: "success", commit: "git-repo" }
- put: slack-alert
params:
text: ":concourse-succeeded: <https://ci.spring.io/teams/${BUILD_TEAM_NAME}/pipelines/${BUILD_PIPELINE_NAME}/jobs/${BUILD_JOB_NAME}/builds/${BUILD_NAME}|${BUILD_PIPELINE_NAME} ${BUILD_JOB_NAME} was successful!>"
silent: true
icon_emoji: ":concourse:"
username: concourse-ci
- name: windows-build - name: windows-build
serial: true serial: true
plan: plan:
@ -591,7 +658,7 @@ jobs:
body: generated-release-notes/release-notes.md body: generated-release-notes/release-notes.md
groups: groups:
- name: "Build" - name: "Build"
jobs: ["build", "jdk11-build", "jdk13-build", "windows-build"] jobs: ["build", "jdk11-build", "jdk13-build", "jdk14-build", "windows-build"]
- name: "Release" - name: "Release"
jobs: ["stage-milestone", "stage-rc", "stage-release", "promote-milestone", "promote-rc", "promote-release", "sync-to-maven-central"] jobs: ["stage-milestone", "stage-rc", "stage-release", "promote-milestone", "promote-rc", "promote-release", "sync-to-maven-central"]
- name: "CI Images" - name: "CI Images"

@ -5,5 +5,14 @@ source $(dirname $0)/common.sh
repository=$(pwd)/distribution-repository repository=$(pwd)/distribution-repository
pushd git-repo > /dev/null pushd git-repo > /dev/null
./gradlew -Dorg.gradle.internal.launcher.welcomeMessageEnabled=false --no-daemon --max-workers=4 -PdeploymentRepository=${repository} build publishAllPublicationsToDeploymentRepository if [[ -d /opt/openjdk-secondary ]]; then
java_version=$( ./$(dirname $0)/get-secondary-java-version.sh )
if [[ ${java_version} = "14" ]]; then
./gradlew -Dorg.gradle.internal.launcher.welcomeMessageEnabled=false --no-daemon --max-workers=4 -PtestJavaHome=/opt/openjdk-secondary -PdeploymentRepository=${repository} build publishAllPublicationsToDeploymentRepository -x :spring-boot-project:spring-boot-tools:spring-boot-gradle-plugin:test
else
./gradlew -Dorg.gradle.internal.launcher.welcomeMessageEnabled=false --no-daemon --max-workers=4 -PtestJavaHome=/opt/openjdk-secondary -PdeploymentRepository=${repository} build publishAllPublicationsToDeploymentRepository
fi
else
./gradlew -Dorg.gradle.internal.launcher.welcomeMessageEnabled=false --no-daemon --max-workers=4 -PdeploymentRepository=${repository} build publishAllPublicationsToDeploymentRepository
fi
popd > /dev/null popd > /dev/null

@ -13,12 +13,16 @@ case "$JDK_VERSION" in
BASE_URL="https://api.adoptopenjdk.net/v3/assets/feature_releases/13" BASE_URL="https://api.adoptopenjdk.net/v3/assets/feature_releases/13"
ISSUE_TITLE="Upgrade Java 13 version in CI image" ISSUE_TITLE="Upgrade Java 13 version in CI image"
;; ;;
java14)
BASE_URL="https://api.adoptopenjdk.net/v3/assets/feature_releases/14/ea"
ISSUE_TITLE="Upgrade Java 14 version in CI image"
;;
*) *)
echo $"Unknown java version" echo $"Unknown java version"
exit 1; exit 1;
esac esac
response=$( curl -s ${BASE_URL}\/ga\?architecture\=x64\&heap_size\=normal\&image_type\=jdk\&jvm_impl\=hotspot\&os\=linux\&sort_order\=DESC\&vendor\=adoptopenjdk ) response=$( curl -s ${BASE_URL}\?architecture\=x64\&heap_size\=normal\&image_type\=jdk\&jvm_impl\=hotspot\&os\=linux\&sort_order\=DESC\&vendor\=adoptopenjdk )
latest=$( jq -r '.[0].binaries[0].package.link' <<< "$response" ) latest=$( jq -r '.[0].binaries[0].package.link' <<< "$response" )
current=$( git-repo/ci/images/get-jdk-url.sh ${JDK_VERSION} ) current=$( git-repo/ci/images/get-jdk-url.sh ${JDK_VERSION} )

@ -0,0 +1,4 @@
#!/bin/bash
set -e
/opt/openjdk-secondary/bin/java -XshowSettings:properties -version 2>&1 | grep "java.specification.version" | awk '{split($0,parts,"="); print parts[2]}' | awk '{$1=$1;print}'
Loading…
Cancel
Save