Skip to content

Commit c5c904a

Browse files
jxblummp911de
authored andcommitted
Update Jenkinsfile to build with a Java 17 baseline.
Closes #2173.
1 parent 98afa1f commit c5c904a

File tree

2 files changed

+36
-58
lines changed

2 files changed

+36
-58
lines changed

Jenkinsfile

+35-57
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ pipeline {
1414
stages {
1515
stage("Docker images") {
1616
parallel {
17-
stage('Publish OpenJDK 8 + Redis 6.2 docker image') {
17+
stage('Publish JDK 17 + Redis 6.2 Docker image') {
1818
when {
1919
anyOf {
20-
changeset "ci/openjdk8-redis-6.2/**"
20+
changeset "ci/openjdk17-redis6.2/**"
2121
changeset "Makefile"
2222
}
2323
}
@@ -26,26 +26,7 @@ pipeline {
2626

2727
steps {
2828
script {
29-
def image = docker.build("springci/spring-data-openjdk8-with-redis-6.2", "-f ci/openjdk8-redis-6.2/Dockerfile .")
30-
docker.withRegistry('', 'hub.docker.com-springbuildmaster') {
31-
image.push()
32-
}
33-
}
34-
}
35-
}
36-
stage('Publish OpenJDK 17 + Redis 6.2 docker image') {
37-
when {
38-
anyOf {
39-
changeset "ci/openjdk16-redis-6.2/**"
40-
changeset "Makefile"
41-
}
42-
}
43-
agent { label 'data' }
44-
options { timeout(time: 20, unit: 'MINUTES') }
45-
46-
steps {
47-
script {
48-
def image = docker.build("springci/spring-data-openjdk17-with-redis-6.2", "-f ci/openjdk17-redis-6.2/Dockerfile .")
29+
def image = docker.build("springci/spring-data-openjdk17-with-redis-6.2", "-f ci/openjdk17-redis6.2/Dockerfile .")
4930
docker.withRegistry('', 'hub.docker.com-springbuildmaster') {
5031
image.push()
5132
}
@@ -55,11 +36,10 @@ pipeline {
5536
}
5637
}
5738

58-
stage("test: baseline (jdk8)") {
39+
stage("test: baseline (Java 17)") {
5940
when {
60-
beforeAgent(true)
6141
anyOf {
62-
branch(pattern: "main|(\\d\\.\\d\\.x)", comparator: "REGEXP")
42+
branch 'main'
6343
not { triggeredBy 'UpstreamCause' }
6444
}
6545
}
@@ -73,51 +53,51 @@ pipeline {
7353
steps {
7454
script {
7555
docker.withRegistry('', 'hub.docker.com-springbuildmaster') {
76-
docker.image('springci/spring-data-openjdk8-with-redis-6.2:latest').inside('-v $HOME:/tmp/jenkins-home') {
56+
docker.image('springci/spring-data-openjdk17-with-redis-6.2:latest').inside('-v $HOME:/tmp/jenkins-home') {
7757
sh 'PROFILE=none LONG_TESTS=true ci/test.sh'
7858
}
7959
}
8060
}
8161
}
8262
}
8363

84-
stage("Test other configurations") {
64+
stage('Release to artifactory') {
8565
when {
86-
beforeAgent(true)
87-
allOf {
88-
branch(pattern: "main|(\\d\\.\\d\\.x)", comparator: "REGEXP")
66+
anyOf {
67+
branch 'main'
8968
not { triggeredBy 'UpstreamCause' }
9069
}
9170
}
92-
parallel {
93-
stage("test: baseline (jdk17)") {
94-
agent {
95-
label 'data'
96-
}
97-
options { timeout(time: 30, unit: 'MINUTES') }
98-
environment {
99-
ARTIFACTORY = credentials('02bd1690-b54f-4c9f-819d-a77cb7a9822c')
100-
}
101-
steps {
102-
script {
103-
docker.withRegistry('', 'hub.docker.com-springbuildmaster') {
104-
docker.image('springci/spring-data-openjdk17-with-redis-6.2:latest').inside('-v $HOME:/tmp/jenkins-home') {
105-
sh 'PROFILE=java11 ci/test.sh'
106-
}
107-
}
71+
agent {
72+
label 'data'
73+
}
74+
options { timeout(time: 20, unit: 'MINUTES') }
75+
76+
environment {
77+
ARTIFACTORY = credentials('02bd1690-b54f-4c9f-819d-a77cb7a9822c')
78+
}
79+
80+
steps {
81+
script {
82+
docker.withRegistry('', 'hub.docker.com-springbuildmaster') {
83+
docker.image('openjdk:17-bullseye').inside('-v $HOME:/tmp/jenkins-home') {
84+
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -s settings.xml -Pci,artifactory ' +
85+
'-Dartifactory.server=https://repo.spring.io ' +
86+
"-Dartifactory.username=${ARTIFACTORY_USR} " +
87+
"-Dartifactory.password=${ARTIFACTORY_PSW} " +
88+
"-Dartifactory.staging-repository=libs-snapshot-local " +
89+
"-Dartifactory.build-name=spring-data-redis " +
90+
"-Dartifactory.build-number=${BUILD_NUMBER} " +
91+
'-Dmaven.test.skip=true clean deploy -U -B'
10892
}
10993
}
11094
}
11195
}
11296
}
11397

114-
stage('Release to artifactory') {
98+
stage('Publish documentation') {
11599
when {
116-
beforeAgent(true)
117-
anyOf {
118-
branch(pattern: "main|(\\d\\.\\d\\.x)", comparator: "REGEXP")
119-
not { triggeredBy 'UpstreamCause' }
120-
}
100+
branch 'main'
121101
}
122102
agent {
123103
label 'data'
@@ -131,14 +111,12 @@ pipeline {
131111
steps {
132112
script {
133113
docker.withRegistry('', 'hub.docker.com-springbuildmaster') {
134-
docker.image('adoptopenjdk/openjdk8:latest').inside('-v $HOME:/tmp/jenkins-home') {
135-
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -s settings.xml -Pci,artifactory ' +
114+
docker.image('openjdk:17-bullseye').inside('-v $HOME:/tmp/jenkins-home') {
115+
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -s settings.xml -Pci,distribute ' +
136116
'-Dartifactory.server=https://repo.spring.io ' +
137117
"-Dartifactory.username=${ARTIFACTORY_USR} " +
138118
"-Dartifactory.password=${ARTIFACTORY_PSW} " +
139-
"-Dartifactory.staging-repository=libs-snapshot-local " +
140-
"-Dartifactory.build-name=spring-data-redis " +
141-
"-Dartifactory.build-number=${BUILD_NUMBER} " +
119+
"-Dartifactory.distribution-repository=temp-private-local " +
142120
'-Dmaven.test.skip=true clean deploy -U -B'
143121
}
144122
}

ci/openjdk8-redis-6.2/Dockerfile renamed to ci/openjdk17-redis6.2/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM adoptopenjdk/openjdk8:latest
1+
FROM openjdk:17-bullseye
22

33
# Copy Spring Data Redis's Makefile into the container
44
COPY ./Makefile /

0 commit comments

Comments
 (0)