Skip to content

Commit 0914bc9

Browse files
committed
DATAREDIS-1258 - Use Docker hub credentials for all CI jobs.
1 parent 4da17f0 commit 0914bc9

File tree

2 files changed

+64
-70
lines changed

2 files changed

+64
-70
lines changed

Jenkinsfile

+59-70
Original file line numberDiff line numberDiff line change
@@ -55,40 +55,25 @@ pipeline {
5555
}
5656
}
5757

58-
stage("test: baseline") {
58+
stage("test: baseline (jdk8)") {
5959
when {
6060
anyOf {
6161
branch '2.4.x'
6262
not { triggeredBy 'UpstreamCause' }
6363
}
6464
}
6565
agent {
66-
docker {
67-
image 'springci/spring-data-openjdk8-with-redis-6.0:latest'
68-
label 'data'
69-
args '-v $HOME/.m2:/tmp/jenkins-home/.m2'
70-
}
66+
label 'data'
7167
}
7268
options { timeout(time: 30, unit: 'MINUTES') }
7369
steps {
74-
// Create link to directory with Redis binaries
75-
sh 'ln -sf /work'
76-
77-
// Launch Redis in proper configuration
78-
sh 'make start'
79-
80-
// Execute maven test
81-
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw clean test -DrunLongTests=true -U -B'
82-
83-
// Capture resulting exit code from maven (pass/fail)
84-
sh 'RESULT=\$?'
85-
86-
// Shutdown Redis
87-
sh 'make stop'
88-
89-
// Return maven results
90-
sh 'exit \$RESULT'
91-
70+
script {
71+
docker.withRegistry('', 'hub.docker.com-springbuildmaster') {
72+
docker.image('springci/spring-data-openjdk8-with-redis-6.0:latest').inside('-v $HOME:/tmp/jenkins-home') {
73+
sh 'PROFILE=none LONG_TESTS=true ci/test.sh'
74+
}
75+
}
76+
}
9277
}
9378
}
9479

@@ -102,32 +87,32 @@ pipeline {
10287
parallel {
10388
stage("test: baseline (jdk11)") {
10489
agent {
105-
docker {
106-
image 'springci/spring-data-openjdk11-with-redis-6.0:latest'
107-
label 'data'
108-
args '-v $HOME/.m2:/tmp/jenkins-home/.m2'
90+
label 'data'
91+
}
92+
options { timeout(time: 30, unit: 'MINUTES') }
93+
steps {
94+
script {
95+
docker.withRegistry('', 'hub.docker.com-springbuildmaster') {
96+
docker.image('springci/spring-data-openjdk11-with-redis-6.0:latest').inside('-v $HOME:/tmp/jenkins-home') {
97+
sh 'PROFILE=java11 ci/test.sh'
98+
}
99+
}
109100
}
110101
}
102+
}
103+
stage("test: baseline (jdk15)") {
104+
agent {
105+
label 'data'
106+
}
111107
options { timeout(time: 30, unit: 'MINUTES') }
112108
steps {
113-
// Create link to directory with Redis binaries
114-
sh 'ln -sf /work'
115-
116-
// Launch Redis in proper configuration
117-
sh 'make start'
118-
119-
// Execute maven test
120-
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pjava11 clean test -U -B'
121-
122-
// Capture resulting exit code from maven (pass/fail)
123-
sh 'RESULT=\$?'
124-
125-
// Shutdown Redis
126-
sh 'make stop'
127-
128-
// Return maven results
129-
sh 'exit \$RESULT'
130-
109+
script {
110+
docker.withRegistry('', 'hub.docker.com-springbuildmaster') {
111+
docker.image('springci/spring-data-openjdk15-with-redis-6.0:latest').inside('-v $HOME:/tmp/jenkins-home') {
112+
sh 'PROFILE=java11 ci/test.sh'
113+
}
114+
}
115+
}
131116
}
132117
}
133118
}
@@ -141,11 +126,7 @@ pipeline {
141126
}
142127
}
143128
agent {
144-
docker {
145-
image 'adoptopenjdk/openjdk8:latest'
146-
label 'data'
147-
args '-v $HOME/.m2:/tmp/jenkins-home/.m2'
148-
}
129+
label 'data'
149130
}
150131
options { timeout(time: 20, unit: 'MINUTES') }
151132

@@ -154,14 +135,20 @@ pipeline {
154135
}
155136

156137
steps {
157-
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,artifactory ' +
158-
'-Dartifactory.server=https://repo.spring.io ' +
159-
"-Dartifactory.username=${ARTIFACTORY_USR} " +
160-
"-Dartifactory.password=${ARTIFACTORY_PSW} " +
161-
"-Dartifactory.staging-repository=libs-snapshot-local " +
162-
"-Dartifactory.build-name=spring-data-redis " +
163-
"-Dartifactory.build-number=${BUILD_NUMBER} " +
164-
'-Dmaven.test.skip=true clean deploy -U -B'
138+
script {
139+
docker.withRegistry('', 'hub.docker.com-springbuildmaster') {
140+
docker.image('adoptopenjdk/openjdk8:latest').inside('-v $HOME:/tmp/jenkins-home') {
141+
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,artifactory ' +
142+
'-Dartifactory.server=https://repo.spring.io ' +
143+
"-Dartifactory.username=${ARTIFACTORY_USR} " +
144+
"-Dartifactory.password=${ARTIFACTORY_PSW} " +
145+
"-Dartifactory.staging-repository=libs-snapshot-local " +
146+
"-Dartifactory.build-name=spring-data-redis " +
147+
"-Dartifactory.build-number=${BUILD_NUMBER} " +
148+
'-Dmaven.test.skip=true clean deploy -U -B'
149+
}
150+
}
151+
}
165152
}
166153
}
167154

@@ -170,11 +157,7 @@ pipeline {
170157
branch '2.4.x'
171158
}
172159
agent {
173-
docker {
174-
image 'adoptopenjdk/openjdk8:latest'
175-
label 'data'
176-
args '-v $HOME/.m2:/tmp/jenkins-home/.m2'
177-
}
160+
label 'data'
178161
}
179162
options { timeout(time: 20, unit: 'MINUTES') }
180163

@@ -183,12 +166,18 @@ pipeline {
183166
}
184167

185168
steps {
186-
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,distribute ' +
187-
'-Dartifactory.server=https://repo.spring.io ' +
188-
"-Dartifactory.username=${ARTIFACTORY_USR} " +
189-
"-Dartifactory.password=${ARTIFACTORY_PSW} " +
190-
"-Dartifactory.distribution-repository=temp-private-local " +
191-
'-Dmaven.test.skip=true clean deploy -U -B'
169+
script {
170+
docker.withRegistry('', 'hub.docker.com-springbuildmaster') {
171+
docker.image('adoptopenjdk/openjdk8:latest').inside('-v $HOME:/tmp/jenkins-home') {
172+
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,distribute ' +
173+
'-Dartifactory.server=https://repo.spring.io ' +
174+
"-Dartifactory.username=${ARTIFACTORY_USR} " +
175+
"-Dartifactory.password=${ARTIFACTORY_PSW} " +
176+
"-Dartifactory.distribution-repository=temp-private-local " +
177+
'-Dmaven.test.skip=true clean deploy -U -B'
178+
}
179+
}
180+
}
192181
}
193182
}
194183
}

pom.xml

+5
Original file line numberDiff line numberDiff line change
@@ -315,5 +315,10 @@
315315
<id>spring-plugins-release</id>
316316
<url>https://repo.spring.io/plugins-release</url>
317317
</pluginRepository>
318+
<pluginRepository>
319+
<id>bintray-plugins</id>
320+
<name>bintray-plugins</name>
321+
<url>https://jcenter.bintray.com</url>
322+
</pluginRepository>
318323
</pluginRepositories>
319324
</project>

0 commit comments

Comments
 (0)