Skip to content

Commit 59b37a7

Browse files
committed
Introduce property for Jenkins user and Artifactory server details.
Closes #2787
1 parent e3f81be commit 59b37a7

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

Jenkinsfile

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pipeline {
3636
steps {
3737
script {
3838
docker.image("harbor-repo.vmware.com/dockerhub-proxy-cache/springci/spring-data-with-redis-6.2:${p['java.main.tag']}").inside('-v $HOME:/tmp/jenkins-home') {
39-
sh 'PROFILE=none LONG_TESTS=true ci/test.sh'
39+
sh "PROFILE=none LONG_TESTS=true JENKINS_USER_NAME=${p['jenkins.user.name']} ci/test.sh"
4040
}
4141
}
4242
}
@@ -62,7 +62,7 @@ pipeline {
6262
steps {
6363
script {
6464
docker.image("harbor-repo.vmware.com/dockerhub-proxy-cache/springci/spring-data-with-redis-6.2:${p['java.main.tag']}").inside('-v $HOME:/tmp/jenkins-home') {
65-
sh 'PROFILE=runtimehints LONG_TESTS=false ci/test.sh'
65+
sh "PROFILE=runtimehints LONG_TESTS=false JENKINS_USER_NAME=${p['jenkins.user.name']} ci/test.sh"
6666
}
6767
}
6868
}
@@ -78,7 +78,7 @@ pipeline {
7878
steps {
7979
script {
8080
docker.image("harbor-repo.vmware.com/dockerhub-proxy-cache/springci/spring-data-with-redis-6.2:${p['java.next.tag']}").inside('-v $HOME:/tmp/jenkins-home') {
81-
sh 'PROFILE=none LONG_TESTS=true ci/test.sh'
81+
sh "PROFILE=none LONG_TESTS=true JENKINS_USER_NAME=${p['jenkins.user.name']} ci/test.sh"
8282
}
8383
}
8484
}
@@ -106,14 +106,15 @@ pipeline {
106106
steps {
107107
script {
108108
docker.image(p['docker.java.main.image']).inside(p['docker.java.inside.basic']) {
109-
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -s settings.xml -Pci,artifactory ' +
110-
'-Dartifactory.server=https://repo.spring.io ' +
109+
sh 'MAVEN_OPTS="-Duser.name=' + "${p['jenkins.user.name']}" + ' -Duser.home=/tmp/jenkins-home" ' +
110+
"./mvnw -s settings.xml -Pci,artifactory " +
111+
"-Dartifactory.server=${p['artifactory.url']} " +
111112
"-Dartifactory.username=${ARTIFACTORY_USR} " +
112113
"-Dartifactory.password=${ARTIFACTORY_PSW} " +
113-
"-Dartifactory.staging-repository=libs-snapshot-local " +
114+
"-Dartifactory.staging-repository=${p['artifactory.repository.snapshot']} " +
114115
"-Dartifactory.build-name=spring-data-redis " +
115116
"-Dartifactory.build-number=${BUILD_NUMBER} " +
116-
'-Dmaven.test.skip=true clean deploy -U -B'
117+
"-Dmaven.test.skip=true clean deploy -U -B"
117118
}
118119
}
119120
}

ci/pipeline.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,6 @@ docker.java.inside.docker=-u root -v /var/run/docker.sock:/var/run/docker.sock -
2525
docker.registry=
2626
docker.credentials=hub.docker.com-springbuildmaster
2727
artifactory.credentials=02bd1690-b54f-4c9f-819d-a77cb7a9822c
28+
artifactory.url=https://repo.spring.io
29+
artifactory.repository.snapshot=libs-snapshot-local
30+
jenkins.user.name=spring-builds+jenkins

ci/test.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ cwd=$(pwd)
1010
# Launch Redis in proper configuration
1111
pushd /tmp && ln -s /work && make -f $cwd/Makefile start && popd
1212

13+
export JENKINS_USER=${JENKINS_USER_NAME}
14+
1315
# Execute maven test
14-
MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -s settings.xml clean test -P${PROFILE} -DrunLongTests=${LONG_TESTS:-false} -U -B
16+
MAVEN_OPTS="-Duser.name=${JENKINS_USER} -Duser.home=/tmp/jenkins-home" ./mvnw -s settings.xml clean test -P${PROFILE} -DrunLongTests=${LONG_TESTS:-false} -U -B
1517

1618
# Capture resulting exit code from maven (pass/fail)
1719
RESULT=$?

0 commit comments

Comments
 (0)