Skip to content

Commit 5733a00

Browse files
committed
Test against Java 20 on CI.
See #4350.
1 parent 894acbb commit 5733a00

File tree

2 files changed

+68
-3
lines changed

2 files changed

+68
-3
lines changed

Jenkinsfile

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,29 @@ pipeline {
7777
}
7878
}
7979
}
80+
stage('Publish JDK (Java 20) + MongoDB 6.0') {
81+
when {
82+
anyOf {
83+
changeset "ci/openjdk20-mongodb-6.0/**"
84+
changeset "ci/pipeline.properties"
85+
}
86+
}
87+
agent { label 'data' }
88+
options { timeout(time: 30, unit: 'MINUTES') }
89+
90+
steps {
91+
script {
92+
def image = docker.build("springci/spring-data-with-mongodb-6.0:${p['java.next.tag']}", "--build-arg BASE=${p['docker.java.next.image']} --build-arg MONGODB=${p['docker.mongodb.6.0.version']} ci/openjdk20-mongodb-6.0/")
93+
docker.withRegistry(p['docker.registry'], p['docker.credentials']) {
94+
image.push()
95+
}
96+
}
97+
}
98+
}
8099
}
81100
}
82101

83-
stage("test: baseline (Java 17)") {
102+
stage("test: baseline (main)") {
84103
when {
85104
beforeAgent(true)
86105
anyOf {
@@ -119,7 +138,7 @@ pipeline {
119138
}
120139
parallel {
121140

122-
stage("test: MongoDB 5.0 (Java 17)") {
141+
stage("test: MongoDB 5.0 (main)") {
123142
agent {
124143
label 'data'
125144
}
@@ -141,7 +160,7 @@ pipeline {
141160
}
142161
}
143162

144-
stage("test: MongoDB 6.0 (Java 17)") {
163+
stage("test: MongoDB 6.0 (main)") {
145164
agent {
146165
label 'data'
147166
}
@@ -162,6 +181,28 @@ pipeline {
162181
}
163182
}
164183
}
184+
185+
stage("test: MongoDB 6.0 (next)") {
186+
agent {
187+
label 'data'
188+
}
189+
options { timeout(time: 30, unit: 'MINUTES') }
190+
environment {
191+
ARTIFACTORY = credentials("${p['artifactory.credentials']}")
192+
}
193+
steps {
194+
script {
195+
docker.image("harbor-repo.vmware.com/dockerhub-proxy-cache/springci/spring-data-with-mongodb-6.0:${p['java.next.tag']}").inside(p['docker.java.inside.basic']) {
196+
sh 'mkdir -p /tmp/mongodb/db /tmp/mongodb/log'
197+
sh 'mongod --setParameter transactionLifetimeLimitSeconds=90 --setParameter maxTransactionLockRequestTimeoutMillis=10000 --dbpath /tmp/mongodb/db --replSet rs0 --fork --logpath /tmp/mongodb/log/mongod.log &'
198+
sh 'sleep 10'
199+
sh 'mongosh --eval "rs.initiate({_id: \'rs0\', members:[{_id: 0, host: \'127.0.0.1:27017\'}]});"'
200+
sh 'sleep 15'
201+
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -s settings.xml clean dependency:list test -Duser.name=jenkins -Dsort -U -B'
202+
}
203+
}
204+
}
205+
}
165206
}
166207
}
167208

ci/openjdk20-mongodb-6.0/Dockerfile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
ARG BASE
2+
FROM ${BASE}
3+
# Any ARG statements before FROM are cleared.
4+
ARG MONGODB
5+
6+
ENV TZ=Etc/UTC
7+
ENV DEBIAN_FRONTEND=noninteractive
8+
9+
RUN set -eux; \
10+
sed -i -e 's/archive.ubuntu.com/mirror.one.com/g' /etc/apt/sources.list && \
11+
sed -i -e 's/security.ubuntu.com/mirror.one.com/g' /etc/apt/sources.list && \
12+
sed -i -e 's/ports.ubuntu.com/mirrors.ocf.berkeley.edu/g' /etc/apt/sources.list && \
13+
sed -i -e 's/http/https/g' /etc/apt/sources.list && \
14+
apt-get update && apt-get install -y apt-transport-https apt-utils gnupg2 wget && \
15+
# MongoDB 6.0 release signing key
16+
wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | apt-key add - && \
17+
# Needed when MongoDB creates a 6.0 folder.
18+
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-6.0.list && \
19+
echo ${TZ} > /etc/timezone
20+
21+
RUN apt-get update && \
22+
apt-get install -y mongodb-org=${MONGODB} mongodb-org-server=${MONGODB} mongodb-org-shell=${MONGODB} mongodb-org-mongos=${MONGODB} mongodb-org-tools=${MONGODB} && \
23+
apt-get clean && \
24+
rm -rf /var/lib/apt/lists/*

0 commit comments

Comments
 (0)