Test with Java 20 in CI.

See #1367.
This commit is contained in:
Greg L. Turnquist
2023-03-29 13:48:04 -05:00
parent 76863f8ba3
commit d0a1b13751
2 changed files with 80 additions and 4 deletions

57
Jenkinsfile vendored
View File

@@ -1,7 +1,7 @@
def p = [:]
node {
checkout scm
p = readProperties interpolate: true, file: 'ci/pipeline.properties'
checkout scm
p = readProperties interpolate: true, file: 'ci/pipeline.properties'
}
pipeline {
@@ -22,7 +22,7 @@ pipeline {
parallel {
stage('Publish JDK 17 + Cassandra 3.11') {
when {
anyOf {
anyOf {
changeset "ci/openjdk17-8-cassandra-3.11/**"
changeset "ci/pipeline.properties"
}
@@ -39,10 +39,29 @@ pipeline {
}
}
}
stage('Publish JDK 20 + Cassandra 3.11') {
when {
anyOf {
changeset "ci/openjdk20-8-cassandra-3.11/**"
changeset "ci/pipeline.properties"
}
}
agent { label 'data' }
options { timeout(time: 30, unit: 'MINUTES') }
steps {
script {
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/")
docker.withRegistry(p['docker.registry'], p['docker.credentials']) {
image.push()
}
}
}
}
}
}
stage("test: baseline (Java 17)") {
stage("test: baseline (main)") {
when {
beforeAgent(true)
anyOf {
@@ -68,6 +87,36 @@ pipeline {
}
}
stage("Test other configurations") {
when {
beforeAgent(true)
allOf {
branch(pattern: "main|(\\d\\.\\d\\.x)", comparator: "REGEXP")
not { triggeredBy 'UpstreamCause' }
}
}
parallel {
stage("test: baseline (next)") {
agent {
label 'data'
}
options { timeout(time: 30, unit: 'MINUTES') }
environment {
ARTIFACTORY = credentials("${p['artifactory.credentials']}")
}
steps {
script {
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') {
sh 'mkdir -p /tmp/jenkins-home'
sh 'JAVA_HOME=/opt/java/openjdk8 /opt/cassandra/bin/cassandra -R &'
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'
}
}
}
}
}
}
stage('Release to artifactory') {
when {
beforeAgent(true)

View File

@@ -0,0 +1,27 @@
ARG BASE
FROM ${BASE}
# Any ARG statements before FROM are cleared.
ARG CASSANDRA
RUN set -eux; \
CASSANDRA_URL="https://archive.apache.org/dist/cassandra/${CASSANDRA}/apache-cassandra-${CASSANDRA}-bin.tar.gz"; \
sed -i -e 's/http/https/g' /etc/apt/sources.list ; \
curl -LfsSo /tmp/cassandra.tar.gz ${CASSANDRA_URL}; \
mkdir -p /opt/cassandra /opt/cassandra/data /opt/cassandra/logs; \
cd /opt/cassandra; \
tar -xf /tmp/cassandra.tar.gz --strip-components=1; \
rm -rf /tmp/cassandra.tar.gz; \
chmod -R a+rwx /opt/cassandra; \
useradd -d /home/jenkins-docker -m -u 1001 -U jenkins-docker;
RUN set -eux; \
BINARY_URL='https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u322-b06/OpenJDK8U-jdk_x64_linux_hotspot_8u322b06.tar.gz'; \
curl -LfsSo /tmp/openjdk.tar.gz ${BINARY_URL}; \
mkdir -p /opt/java/openjdk8; \
cd /opt/java/openjdk8; \
tar -xf /tmp/openjdk.tar.gz --strip-components=1; \
rm -rf /tmp/openjdk.tar.gz;
ENV PATH="/opt/java/openjdk8/bin:$PATH"
ENV MAX_HEAP_SIZE=1500M
ENV HEAP_NEWSIZE=300M