Skip to content

Commit d0a1b13

Browse files
committed
Test with Java 20 in CI.
See #1367.
1 parent 76863f8 commit d0a1b13

File tree

2 files changed

+80
-4
lines changed

2 files changed

+80
-4
lines changed

Jenkinsfile

+53-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
def p = [:]
22
node {
3-
checkout scm
4-
p = readProperties interpolate: true, file: 'ci/pipeline.properties'
3+
checkout scm
4+
p = readProperties interpolate: true, file: 'ci/pipeline.properties'
55
}
66

77
pipeline {
@@ -22,7 +22,7 @@ pipeline {
2222
parallel {
2323
stage('Publish JDK 17 + Cassandra 3.11') {
2424
when {
25-
anyOf {
25+
anyOf {
2626
changeset "ci/openjdk17-8-cassandra-3.11/**"
2727
changeset "ci/pipeline.properties"
2828
}
@@ -39,10 +39,29 @@ pipeline {
3939
}
4040
}
4141
}
42+
stage('Publish JDK 20 + Cassandra 3.11') {
43+
when {
44+
anyOf {
45+
changeset "ci/openjdk20-8-cassandra-3.11/**"
46+
changeset "ci/pipeline.properties"
47+
}
48+
}
49+
agent { label 'data' }
50+
options { timeout(time: 30, unit: 'MINUTES') }
51+
52+
steps {
53+
script {
54+
def image = docker.build("springci/spring-data-with-cassandra-3.11:${p['java.next.tag']}", "--build-arg BASE=${p['docker.java.next.image']} --build-arg CASSANDRA=${p['docker.cassandra.3.version']} ci/openjdk20-8-cassandra-3.11/")
55+
docker.withRegistry(p['docker.registry'], p['docker.credentials']) {
56+
image.push()
57+
}
58+
}
59+
}
60+
}
4261
}
4362
}
4463

45-
stage("test: baseline (Java 17)") {
64+
stage("test: baseline (main)") {
4665
when {
4766
beforeAgent(true)
4867
anyOf {
@@ -68,6 +87,36 @@ pipeline {
6887
}
6988
}
7089

90+
stage("Test other configurations") {
91+
when {
92+
beforeAgent(true)
93+
allOf {
94+
branch(pattern: "main|(\\d\\.\\d\\.x)", comparator: "REGEXP")
95+
not { triggeredBy 'UpstreamCause' }
96+
}
97+
}
98+
parallel {
99+
stage("test: baseline (next)") {
100+
agent {
101+
label 'data'
102+
}
103+
options { timeout(time: 30, unit: 'MINUTES') }
104+
environment {
105+
ARTIFACTORY = credentials("${p['artifactory.credentials']}")
106+
}
107+
steps {
108+
script {
109+
docker.image("harbor-repo.vmware.com/dockerhub-proxy-cache/springci/spring-data-with-cassandra-3.11:${p['java.next.tag']}").inside('-v $HOME:/tmp/jenkins-home') {
110+
sh 'mkdir -p /tmp/jenkins-home'
111+
sh 'JAVA_HOME=/opt/java/openjdk8 /opt/cassandra/bin/cassandra -R &'
112+
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -s settings.xml -Pci,external-cassandra clean dependency:list verify -Dsort -U -B'
113+
}
114+
}
115+
}
116+
}
117+
}
118+
}
119+
71120
stage('Release to artifactory') {
72121
when {
73122
beforeAgent(true)
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
ARG BASE
2+
FROM ${BASE}
3+
# Any ARG statements before FROM are cleared.
4+
ARG CASSANDRA
5+
6+
RUN set -eux; \
7+
CASSANDRA_URL="https://archive.apache.org/dist/cassandra/${CASSANDRA}/apache-cassandra-${CASSANDRA}-bin.tar.gz"; \
8+
sed -i -e 's/http/https/g' /etc/apt/sources.list ; \
9+
curl -LfsSo /tmp/cassandra.tar.gz ${CASSANDRA_URL}; \
10+
mkdir -p /opt/cassandra /opt/cassandra/data /opt/cassandra/logs; \
11+
cd /opt/cassandra; \
12+
tar -xf /tmp/cassandra.tar.gz --strip-components=1; \
13+
rm -rf /tmp/cassandra.tar.gz; \
14+
chmod -R a+rwx /opt/cassandra; \
15+
useradd -d /home/jenkins-docker -m -u 1001 -U jenkins-docker;
16+
17+
RUN set -eux; \
18+
BINARY_URL='https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u322-b06/OpenJDK8U-jdk_x64_linux_hotspot_8u322b06.tar.gz'; \
19+
curl -LfsSo /tmp/openjdk.tar.gz ${BINARY_URL}; \
20+
mkdir -p /opt/java/openjdk8; \
21+
cd /opt/java/openjdk8; \
22+
tar -xf /tmp/openjdk.tar.gz --strip-components=1; \
23+
rm -rf /tmp/openjdk.tar.gz;
24+
25+
ENV PATH="/opt/java/openjdk8/bin:$PATH"
26+
ENV MAX_HEAP_SIZE=1500M
27+
ENV HEAP_NEWSIZE=300M

0 commit comments

Comments
 (0)