Skip to content

Commit

Permalink
Use Docker in Docker CI setup.
Browse files Browse the repository at this point in the history
See #1521
  • Loading branch information
mp911de committed Oct 9, 2024
1 parent e420602 commit d8495d8
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ pipeline {
steps {
script {
docker.withRegistry(p['docker.proxy.registry'], p['docker.proxy.credentials']) {
docker.image("springci/spring-data-with-cassandra-3.11:${p['java.main.tag']}").inside('-v $HOME:/tmp/jenkins-home') {
docker.image("springci/spring-data-with-cassandra-3.11:${p['java.main.tag']}").inside(p['docker.java.inside.docker']) {
sh 'mkdir -p /tmp/jenkins-home'
sh 'JAVA_HOME=/opt/java/openjdk8 /opt/cassandra/bin/cassandra -R &'
sh 'MAVEN_OPTS="-Duser.name=' + "${p['jenkins.user.name']}" + ' -Duser.home=/tmp/jenkins-home" ' +
"./mvnw -s settings.xml -Pci,external-cassandra " +
"./mvnw -s settings.xml -Pci,external-cassandra -Ddevelocity.storage.directory=/tmp/jenkins-home/.develocity-root -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-cassandra " +
"clean dependency:list verify -Dsort -U -B"
}
}
Expand Down Expand Up @@ -111,11 +111,11 @@ pipeline {
steps {
script {
docker.withRegistry(p['docker.proxy.registry'], p['docker.proxy.credentials']) {
docker.image("springci/spring-data-with-cassandra-3.11:${p['java.next.tag']}").inside('-v $HOME:/tmp/jenkins-home') {
docker.image("springci/spring-data-with-cassandra-3.11:${p['java.next.tag']}").inside(p['docker.java.inside.docker']) {
sh 'mkdir -p /tmp/jenkins-home'
sh 'JAVA_HOME=/opt/java/openjdk8 /opt/cassandra/bin/cassandra -R &'
sh 'MAVEN_OPTS="-Duser.name=' + "${p['jenkins.user.name']}" + ' -Duser.home=/tmp/jenkins-home" ' +
"./mvnw -s settings.xml -Pci,external-cassandra " +
"./mvnw -s settings.xml -Pci,external-cassandra -Ddevelocity.storage.directory=/tmp/jenkins-home/.develocity-root -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-cassandra " +
"clean dependency:list verify -Dsort -U -B"
}
}
Expand Down Expand Up @@ -144,16 +144,18 @@ pipeline {
steps {
script {
docker.withRegistry(p['docker.proxy.registry'], p['docker.proxy.credentials']) {
docker.image(p['docker.java.main.image']).inside(p['docker.java.inside.basic']) {
docker.image(p['docker.java.main.image']).inside(p['docker.java.inside.docker']) {
sh 'mkdir -p /tmp/jenkins-home'
sh 'MAVEN_OPTS="-Duser.name=' + "${p['jenkins.user.name']}" + ' -Duser.home=/tmp/jenkins-home" ' +
"./mvnw -s settings.xml -Pci,artifactory " +
"-Ddevelocity.storage.directory=/tmp/jenkins-home/.develocity-root " +
"-Dartifactory.server=${p['artifactory.url']} " +
"-Dartifactory.username=${ARTIFACTORY_USR} " +
"-Dartifactory.password=${ARTIFACTORY_PSW} " +
"-Dartifactory.staging-repository=${p['artifactory.repository.snapshot']} " +
"-Dartifactory.build-name=spring-data-cassandra " +
"-Dartifactory.build-number=spring-data-cassandra-${BRANCH_NAME}-build-${BUILD_NUMBER} " +
"-Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-cassandra " +
"-Dmaven.test.skip=true clean deploy -U -B"
}
}
Expand Down

0 comments on commit d8495d8

Please sign in to comment.