Skip to content

Commit cb80b7d

Browse files
committed
Add Java 17 to CI pipeline.
Also, refine CI triggers. Closes #1171
1 parent 11c6dba commit cb80b7d

File tree

2 files changed

+15
-40
lines changed

2 files changed

+15
-40
lines changed

Jenkinsfile

+11-37
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,16 @@ pipeline {
4646
}
4747
}
4848
}
49-
stage('Publish JDK 16 + Cassandra 3.11') {
49+
stage('Publish JDK 17 + Cassandra 3.11') {
5050
when {
51-
changeset "ci/openjdk16-8-cassandra-3.11/**"
51+
changeset "ci/openjdk17-8-cassandra-3.11/**"
5252
}
5353
agent { label 'data' }
5454
options { timeout(time: 30, unit: 'MINUTES') }
5555

5656
steps {
5757
script {
58-
def image = docker.build("springci/spring-data-openjdk16-8-cassandra-3.11", "ci/openjdk16-8-cassandra-3.11/")
58+
def image = docker.build("springci/spring-data-openjdk17-8-cassandra-3.11", "ci/openjdk16-8-cassandra-3.11/")
5959
docker.withRegistry('', 'hub.docker.com-springbuildmaster') {
6060
image.push()
6161
}
@@ -67,8 +67,9 @@ pipeline {
6767

6868
stage("test: baseline (jdk8)") {
6969
when {
70+
beforeAgent(true)
7071
anyOf {
71-
branch 'main'
72+
branch(pattern: "main|(\\d\\.\\d\\.x)", comparator: "REGEXP")
7273
not { triggeredBy 'UpstreamCause' }
7374
}
7475
}
@@ -94,8 +95,9 @@ pipeline {
9495

9596
stage("Test other configurations") {
9697
when {
98+
beforeAgent(true)
9799
allOf {
98-
branch 'main'
100+
branch(pattern: "main|(\\d\\.\\d\\.x)", comparator: "REGEXP")
99101
not { triggeredBy 'UpstreamCause' }
100102
}
101103
}
@@ -120,7 +122,7 @@ pipeline {
120122
}
121123
}
122124
}
123-
stage("test: baseline (jdk16)") {
125+
stage("test: baseline (jdk17)") {
124126
agent {
125127
label 'data'
126128
}
@@ -131,7 +133,7 @@ pipeline {
131133
steps {
132134
script {
133135
docker.withRegistry('', 'hub.docker.com-springbuildmaster') {
134-
docker.image('springci/spring-data-openjdk16-8-cassandra-3.11:latest').inside('-v $HOME:/tmp/jenkins-home') {
136+
docker.image('springci/spring-data-openjdk17-8-cassandra-3.11:latest').inside('-v $HOME:/tmp/jenkins-home') {
135137
sh 'mkdir -p /tmp/jenkins-home'
136138
sh 'JAVA_HOME=/opt/java/openjdk8 /opt/cassandra/bin/cassandra -R &'
137139
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -s settings.xml -Pci,external-cassandra,java11 clean dependency:list verify -Dsort -U -B'
@@ -144,8 +146,9 @@ pipeline {
144146
}
145147
stage('Release to artifactory') {
146148
when {
149+
beforeAgent(true)
147150
anyOf {
148-
branch 'main'
151+
branch(pattern: "main|(\\d\\.\\d\\.x)", comparator: "REGEXP")
149152
not { triggeredBy 'UpstreamCause' }
150153
}
151154
}
@@ -176,35 +179,6 @@ pipeline {
176179
}
177180
}
178181
}
179-
stage('Publish documentation') {
180-
when {
181-
branch 'main'
182-
}
183-
agent {
184-
label 'data'
185-
}
186-
options { timeout(time: 20, unit: 'MINUTES') }
187-
188-
environment {
189-
ARTIFACTORY = credentials('02bd1690-b54f-4c9f-819d-a77cb7a9822c')
190-
}
191-
192-
steps {
193-
script {
194-
docker.withRegistry('', 'hub.docker.com-springbuildmaster') {
195-
docker.image('adoptopenjdk/openjdk8:latest').inside('-v $HOME:/tmp/jenkins-home') {
196-
sh 'mkdir -p /tmp/jenkins-home'
197-
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -s settings.xml -Pci,distribute ' +
198-
'-Dartifactory.server=https://repo.spring.io ' +
199-
"-Dartifactory.username=${ARTIFACTORY_USR} " +
200-
"-Dartifactory.password=${ARTIFACTORY_PSW} " +
201-
"-Dartifactory.distribution-repository=temp-private-local " +
202-
'-Dmaven.test.skip=true clean deploy -U -B'
203-
}
204-
}
205-
}
206-
}
207-
}
208182
}
209183

210184
post {

ci/openjdk16-8-cassandra-3.11/Dockerfile renamed to ci/openjdk17-8-cassandra-3.11/Dockerfile

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

33
RUN set -eux; \
4-
CASSANDRA_URL='https://www-us.apache.org/dist/cassandra/3.11.10/apache-cassandra-3.11.10-bin.tar.gz'; \
4+
CASSANDRA_URL='https://archive.apache.org/dist/cassandra/3.11.10/apache-cassandra-3.11.10-bin.tar.gz'; \
5+
sed -i -e 's/http/https/g' /etc/apt/sources.list ; \
56
curl -LfsSo /tmp/cassandra.tar.gz ${CASSANDRA_URL}; \
67
mkdir -p /opt/cassandra /opt/cassandra/data /opt/cassandra/logs; \
78
cd /opt/cassandra; \
@@ -11,7 +12,7 @@ RUN set -eux; \
1112
useradd -d /home/jenkins-docker -m -u 1001 -U jenkins-docker;
1213

1314
RUN set -eux; \
14-
BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u275-b01/OpenJDK8U-jdk_x64_linux_hotspot_8u275b01.tar.gz'; \
15+
BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u292-b10/OpenJDK8U-jdk_x64_linux_hotspot_8u292b10.tar.gz'; \
1516
curl -LfsSo /tmp/openjdk.tar.gz ${BINARY_URL}; \
1617
mkdir -p /opt/java/openjdk8; \
1718
cd /opt/java/openjdk8; \

0 commit comments

Comments
 (0)