Skip to content

Commit c5f269a

Browse files
Update CI build to test against MongoDB Server 8.0
1 parent 225015d commit c5f269a

File tree

4 files changed

+76
-0
lines changed

4 files changed

+76
-0
lines changed

Jenkinsfile

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,25 @@ pipeline {
134134
}
135135
}
136136
}
137+
stage('Publish JDK (Java 17) + MongoDB 8.0') {
138+
when {
139+
anyOf {
140+
changeset "ci/openjdk17-mongodb-8.0/**"
141+
changeset "ci/pipeline.properties"
142+
}
143+
}
144+
agent { label 'data' }
145+
options { timeout(time: 30, unit: 'MINUTES') }
146+
147+
steps {
148+
script {
149+
def image = docker.build("springci/spring-data-with-mongodb-8.0:${p['java.main.tag']}", "--build-arg BASE=${p['docker.java.main.image']} --build-arg MONGODB=${p['docker.mongodb.8.0.version']} ci/openjdk17-mongodb-8.0/")
150+
docker.withRegistry(p['docker.registry'], p['docker.credentials']) {
151+
image.push()
152+
}
153+
}
154+
}
155+
}
137156
}
138157
}
139158

@@ -308,6 +327,32 @@ pipeline {
308327
}
309328
}
310329
}
330+
331+
stage("test: MongoDB 8.0 (main)") {
332+
agent {
333+
label 'data'
334+
}
335+
options { timeout(time: 30, unit: 'MINUTES') }
336+
environment {
337+
ARTIFACTORY = credentials("${p['artifactory.credentials']}")
338+
DEVELOCITY_ACCESS_KEY = credentials("${p['develocity.access-key']}")
339+
}
340+
steps {
341+
script {
342+
docker.withRegistry(p['docker.proxy.registry'], p['docker.proxy.credentials']) {
343+
docker.image("springci/spring-data-with-mongodb-8.0:${p['java.main.tag']}").inside(p['docker.java.inside.basic']) {
344+
sh 'mkdir -p /tmp/mongodb/db /tmp/mongodb/log'
345+
sh 'mongod --setParameter transactionLifetimeLimitSeconds=90 --setParameter maxTransactionLockRequestTimeoutMillis=10000 --dbpath /tmp/mongodb/db --replSet rs0 --fork --logpath /tmp/mongodb/log/mongod.log &'
346+
sh 'sleep 10'
347+
sh 'mongosh --eval "rs.initiate({_id: \'rs0\', members:[{_id: 0, host: \'127.0.0.1:27017\'}]});"'
348+
sh 'sleep 15'
349+
sh 'MAVEN_OPTS="-Duser.name=' + "${p['jenkins.user.name']}" + ' -Duser.home=/tmp/jenkins-home" ' +
350+
"./mvnw -s settings.xml clean dependency:list test -Dsort -U -B"
351+
}
352+
}
353+
}
354+
}
355+
}
311356
}
312357
}
313358

ci/openjdk17-mongodb-8.0/Dockerfile

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

ci/pipeline.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ docker.mongodb.4.4.version=4.4.25
1111
docker.mongodb.5.0.version=5.0.21
1212
docker.mongodb.6.0.version=6.0.10
1313
docker.mongodb.7.0.version=7.0.2
14+
docker.mongodb.8.0.version=8.0.0
1415

1516
# Supported versions of Redis
1617
docker.redis.6.version=6.2.13

src/main/antora/modules/ROOT/pages/preface.adoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ See also the https://www.mongodb.com/docs/drivers/java/sync/current/compatibilit
2222
|Driver Version
2323
|Database Versions
2424
25+
|2024.1
26+
|4.4.x
27+
|5.x
28+
|4.4.x, 5.x, 6.x, 7.x, 8.x
29+
2530
|2024.0
2631
|4.3.x
2732
|4.11.x & 5.x

0 commit comments

Comments
 (0)