Browse Source

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

pull/187/head
Mark Paluch 6 years ago
parent
commit
8d80a1f29b
No known key found for this signature in database
GPG Key ID: 51A00FA751B91849
  1. 16
      Jenkinsfile

16
Jenkinsfile vendored

@ -29,9 +29,8 @@ pipeline {
} }
options { timeout(time: 30, unit: 'MINUTES') } options { timeout(time: 30, unit: 'MINUTES') }
steps { steps {
sh 'rm -rf ?' sh 'mkdir -p /tmp/jenkins-home'
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,all-dbs clean dependency:list test -Dsort -U -B' 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"
} }
} }
@ -54,9 +53,8 @@ pipeline {
} }
options { timeout(time: 30, unit: 'MINUTES') } options { timeout(time: 30, unit: 'MINUTES') }
steps { steps {
sh 'rm -rf ?' sh 'mkdir -p /tmp/jenkins-home'
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,all-dbs,java11 clean dependency:list test -Dsort -U -B' sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,all-dbs,java11 clean dependency:list test -Dsort -U -B'
sh "chown -R 1001:1001 target"
} }
} }
@ -71,9 +69,8 @@ pipeline {
} }
options { timeout(time: 30, unit: 'MINUTES') } options { timeout(time: 30, unit: 'MINUTES') }
steps { steps {
sh 'rm -rf ?' sh 'mkdir -p /tmp/jenkins-home'
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,all-dbs,java11 clean dependency:list test -Dsort -U -B' sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,all-dbs,java11 clean dependency:list test -Dsort -U -B'
sh "chown -R 1001:1001 target"
} }
} }
} }
@ -90,7 +87,7 @@ pipeline {
docker { docker {
image 'adoptopenjdk/openjdk8:latest' image 'adoptopenjdk/openjdk8:latest'
label 'data' label 'data'
args '-v $HOME:/tmp/jenkins-home' args '-v $HOME/.m2:/tmp/jenkins-home/.m2'
} }
} }
options { timeout(time: 20, unit: 'MINUTES') } options { timeout(time: 20, unit: 'MINUTES') }
@ -100,7 +97,7 @@ pipeline {
} }
steps { steps {
sh 'rm -rf ?' sh 'mkdir -p /tmp/jenkins-home'
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,artifactory ' + sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,artifactory ' +
'-Dartifactory.server=https://repo.spring.io ' + '-Dartifactory.server=https://repo.spring.io ' +
"-Dartifactory.username=${ARTIFACTORY_USR} " + "-Dartifactory.username=${ARTIFACTORY_USR} " +
@ -120,7 +117,7 @@ pipeline {
docker { docker {
image 'adoptopenjdk/openjdk8:latest' image 'adoptopenjdk/openjdk8:latest'
label 'data' label 'data'
args '-v $HOME:/tmp/jenkins-home' args '-v $HOME/.m2:/tmp/jenkins-home/.m2'
} }
} }
options { timeout(time: 20, unit: 'MINUTES') } options { timeout(time: 20, unit: 'MINUTES') }
@ -130,6 +127,7 @@ pipeline {
} }
steps { steps {
sh 'mkdir -p /tmp/jenkins-home'
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,distribute ' + sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,distribute ' +
'-Dartifactory.server=https://repo.spring.io ' + '-Dartifactory.server=https://repo.spring.io ' +
"-Dartifactory.username=${ARTIFACTORY_USR} " + "-Dartifactory.username=${ARTIFACTORY_USR} " +

Loading…
Cancel
Save