Skip to content

Commit 9128ea7

Browse files
committed
DATAJDBC-628 - Enable Maven caching for Jenkins jobs.
Also, run all database integration tests for Java 8 baseline only.
1 parent 4e7ba05 commit 9128ea7

File tree

1 file changed

+10
-22
lines changed

1 file changed

+10
-22
lines changed

Jenkinsfile

+10-22
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,15 @@ pipeline {
2323
docker {
2424
image 'adoptopenjdk/openjdk8:latest'
2525
label 'data'
26-
args '-u root -v /var/run/docker.sock:/var/run/docker.sock'
27-
// root but with no maven caching
26+
args '-u root -v /var/run/docker.sock:/var/run/docker.sock -v $HOME:/tmp/jenkins-home'
2827
}
2928
}
3029
options { timeout(time: 30, unit: 'MINUTES') }
3130
steps {
3231
sh './accept-third-party-license.sh'
3332
sh 'mkdir -p /tmp/jenkins-home'
3433
sh 'chown -R 1001:1001 .'
35-
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,all-dbs clean dependency:list test -Dsort -U -B'
36-
sh 'chown -R 1001:1001 .'
34+
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,all-dbs clean dependency:list test -Dsort -U -B -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-jdbc'
3735
}
3836
}
3937

@@ -50,17 +48,13 @@ pipeline {
5048
docker {
5149
image 'adoptopenjdk/openjdk11:latest'
5250
label 'data'
53-
args '-u root -v /var/run/docker.sock:/var/run/docker.sock'
54-
// root but with no maven caching
51+
args '-u root -v /var/run/docker.sock:/var/run/docker.sock -v $HOME:/tmp/jenkins-home'
5552
}
5653
}
5754
options { timeout(time: 30, unit: 'MINUTES') }
5855
steps {
5956
sh './accept-third-party-license.sh'
60-
sh 'mkdir -p /tmp/jenkins-home'
61-
sh 'chown -R 1001:1001 .'
62-
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,all-dbs,java11 clean dependency:list test -Dsort -U -B'
63-
sh 'chown -R 1001:1001 .'
57+
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,java11 clean dependency:list test -Dsort -U -B -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-jdbc'
6458
}
6559
}
6660

@@ -69,17 +63,13 @@ pipeline {
6963
docker {
7064
image 'adoptopenjdk/openjdk15:latest'
7165
label 'data'
72-
args '-u root -v /var/run/docker.sock:/var/run/docker.sock'
73-
// root but with no maven caching
66+
args '-u root -v /var/run/docker.sock:/var/run/docker.sock -v $HOME:/tmp/jenkins-home'
7467
}
7568
}
7669
options { timeout(time: 30, unit: 'MINUTES') }
7770
steps {
7871
sh './accept-third-party-license.sh'
79-
sh 'mkdir -p /tmp/jenkins-home'
80-
sh 'chown -R 1001:1001 .'
81-
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,all-dbs,java11 clean dependency:list test -Dsort -U -B'
82-
sh 'chown -R 1001:1001 .'
72+
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,java11 clean dependency:list test -Dsort -U -B -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-jdbc'
8373
}
8474
}
8575
}
@@ -96,7 +86,7 @@ pipeline {
9686
docker {
9787
image 'adoptopenjdk/openjdk8:latest'
9888
label 'data'
99-
args '-v $HOME/.m2:/tmp/jenkins-home/.m2'
89+
args '-u root -v /var/run/docker.sock:/var/run/docker.sock -v $HOME:/tmp/jenkins-home'
10090
}
10191
}
10292
options { timeout(time: 20, unit: 'MINUTES') }
@@ -106,8 +96,7 @@ pipeline {
10696
}
10797

10898
steps {
109-
sh 'mkdir -p /tmp/jenkins-home'
110-
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,artifactory ' +
99+
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,artifactory -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-jdbc ' +
111100
'-Dartifactory.server=https://repo.spring.io ' +
112101
"-Dartifactory.username=${ARTIFACTORY_USR} " +
113102
"-Dartifactory.password=${ARTIFACTORY_PSW} " +
@@ -126,7 +115,7 @@ pipeline {
126115
docker {
127116
image 'adoptopenjdk/openjdk8:latest'
128117
label 'data'
129-
args '-v $HOME/.m2:/tmp/jenkins-home/.m2'
118+
args '-u root -v /var/run/docker.sock:/var/run/docker.sock -v $HOME:/tmp/jenkins-home'
130119
}
131120
}
132121
options { timeout(time: 20, unit: 'MINUTES') }
@@ -136,8 +125,7 @@ pipeline {
136125
}
137126

138127
steps {
139-
sh 'mkdir -p /tmp/jenkins-home'
140-
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,distribute ' +
128+
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,distribute -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-jdbc ' +
141129
'-Dartifactory.server=https://repo.spring.io ' +
142130
"-Dartifactory.username=${ARTIFACTORY_USR} " +
143131
"-Dartifactory.password=${ARTIFACTORY_PSW} " +

0 commit comments

Comments
 (0)