Browse Source

DATAJDBC-442 - Run Docker on Jenkins with m2 home mount.

1.0.x
Mark Paluch 6 years ago
parent
commit
9299cd554a
No known key found for this signature in database
GPG Key ID: 51A00FA751B91849
  1. 28
      Jenkinsfile

28
Jenkinsfile vendored

@ -25,28 +25,32 @@ pipeline { @@ -25,28 +25,32 @@ pipeline {
docker {
image 'adoptopenjdk/openjdk8:latest'
label 'data'
args '-u root -v /var/run/docker.sock:/var/run/docker.sock' // root but with no maven caching
args '-u root -v /var/run/docker.sock:/var/run/docker.sock'
// root but with no maven caching
}
}
options { timeout(time: 30, unit: 'MINUTES') }
steps {
sh 'rm -rf ?'
sh 'mkdir -p /tmp/jenkins-home'
sh 'chown -R 1001:1001 .'
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,all-dbs clean dependency:list test -Dsort -U -B'
sh "chown -R 1001:1001 target"
sh 'chown -R 1001:1001 .'
}
}
}
}
stage('Release to artifactory') {
when {
branch 'issue/*'
anyOf {
branch '1.0.x'
not { triggeredBy 'UpstreamCause' }
}
}
agent {
docker {
image 'adoptopenjdk/openjdk8:latest'
label 'data'
args '-v $HOME:/tmp/jenkins-home'
args '-v $HOME/.m2:/tmp/jenkins-home/.m2'
}
}
options { timeout(time: 20, unit: 'MINUTES') }
@ -56,7 +60,7 @@ pipeline { @@ -56,7 +60,7 @@ pipeline {
}
steps {
sh 'rm -rf ?'
sh 'mkdir -p /tmp/jenkins-home'
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,artifactory ' +
'-Dartifactory.server=https://repo.spring.io ' +
"-Dartifactory.username=${ARTIFACTORY_USR} " +
@ -67,7 +71,7 @@ pipeline { @@ -67,7 +71,7 @@ pipeline {
'-Dmaven.test.skip=true clean deploy -U -B'
}
}
stage('Release to artifactory with docs') {
stage('Publish documentation') {
when {
branch '1.0.x'
}
@ -75,7 +79,7 @@ pipeline { @@ -75,7 +79,7 @@ pipeline {
docker {
image 'adoptopenjdk/openjdk8:latest'
label 'data'
args '-v $HOME:/tmp/jenkins-home'
args '-v $HOME/.m2:/tmp/jenkins-home/.m2'
}
}
options { timeout(time: 20, unit: 'MINUTES') }
@ -85,14 +89,12 @@ pipeline { @@ -85,14 +89,12 @@ pipeline {
}
steps {
sh 'rm -rf ?'
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,artifactory ' +
sh 'mkdir -p /tmp/jenkins-home'
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,distribute ' +
'-Dartifactory.server=https://repo.spring.io ' +
"-Dartifactory.username=${ARTIFACTORY_USR} " +
"-Dartifactory.password=${ARTIFACTORY_PSW} " +
"-Dartifactory.staging-repository=libs-snapshot-local " +
"-Dartifactory.build-name=spring-data-jdbc-1.0 " +
"-Dartifactory.build-number=${BUILD_NUMBER} " +
"-Dartifactory.distribution-repository=temp-private-local " +
'-Dmaven.test.skip=true clean deploy -U -B'
}
}

Loading…
Cancel
Save