Skip to content

Commit 82d022a

Browse files
committed
Polishing.
Extract Docker and Artifactory credentials into properties file. See #1313
1 parent ab0ca08 commit 82d022a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Jenkinsfile

+5-5
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ pipeline {
3131
}
3232
options { timeout(time: 30, unit: 'MINUTES') }
3333
environment {
34-
DOCKER_HUB = credentials('hub.docker.com-springbuildmaster')
35-
ARTIFACTORY = credentials('02bd1690-b54f-4c9f-819d-a77cb7a9822c')
34+
DOCKER_HUB = credentials("${p['docker.credentials']}")
35+
ARTIFACTORY = credentials("${p['artifactory.credentials']}")
3636
}
3737
steps {
3838
script {
39-
docker.withRegistry('', 'hub.docker.com-springbuildmaster') {
39+
docker.withRegistry(p['docker.registry'], p['docker.credentials']) {
4040
docker.image(p['docker.java.main.image']).inside(p['docker.java.inside.docker']) {
4141
sh "docker login --username ${DOCKER_HUB_USR} --password ${DOCKER_HUB_PSW}"
4242
sh 'PROFILE=ci ci/test.sh'
@@ -61,12 +61,12 @@ pipeline {
6161
options { timeout(time: 20, unit: 'MINUTES') }
6262

6363
environment {
64-
ARTIFACTORY = credentials('02bd1690-b54f-4c9f-819d-a77cb7a9822c')
64+
ARTIFACTORY = credentials("${p['artifactory.credentials']}")
6565
}
6666

6767
steps {
6868
script {
69-
docker.withRegistry('', 'hub.docker.com-springbuildmaster') {
69+
docker.withRegistry(p['docker.registry'], p['docker.credentials']) {
7070
docker.image(p['docker.java.main.image']).inside(p['docker.java.inside.basic']) {
7171
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -s settings.xml -Pci,artifactory -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-couchbase-non-root ' +
7272
'-Dartifactory.server=https://repo.spring.io ' +

0 commit comments

Comments
 (0)