diff --git a/Jenkinsfile b/Jenkinsfile index 086c1b67b..d36620247 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -42,7 +42,8 @@ pipeline { sh 'sleep 10' sh 'mongo --eval "rs.initiate({_id: \'rs0\', members:[{_id: 0, host: \'127.0.0.1:27017\'}]});"' sh 'sleep 15' - sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -s settings.xml clean dependency:list test -Dsort -U -B -Pit' + sh 'MAVEN_OPTS="-Duser.name=' + "${p['jenkins.user.name']}" + ' -Duser.home=/tmp/jenkins-home" ' + + './mvnw -s settings.xml clean dependency:list test -Dsort -U -B -Pit' } } } @@ -73,7 +74,8 @@ pipeline { sh 'sleep 10' sh 'mongosh --eval "rs.initiate({_id: \'rs0\', members:[{_id: 0, host: \'127.0.0.1:27017\'}]});"' sh 'sleep 15' - sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -s settings.xml clean dependency:list test -Dsort -U -B -Pit' + sh 'MAVEN_OPTS="-Duser.name=' + "${p['jenkins.user.name']}" + ' -Duser.home=/tmp/jenkins-home" ' + + './mvnw -s settings.xml clean dependency:list test -Dsort -U -B -Pit' } } } @@ -101,14 +103,15 @@ pipeline { steps { script { docker.image(p['docker.java.main.image']).inside(p['docker.java.inside.basic']) { - sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -s settings.xml -Pci,artifactory ' + - '-Dartifactory.server=https://repo.spring.io ' + + sh 'MAVEN_OPTS="-Duser.name=' + "${p['jenkins.user.name']}" + ' -Duser.home=/tmp/jenkins-home" ' + + "./mvnw -s settings.xml -Pci,artifactory " + + "-Dartifactory.server=${p['artifactory.url']} " + "-Dartifactory.username=${ARTIFACTORY_USR} " + "-Dartifactory.password=${ARTIFACTORY_PSW} " + - "-Dartifactory.staging-repository=libs-snapshot-local " + + "-Dartifactory.staging-repository=${p['artifactory.repository.snapshot']} " + "-Dartifactory.build-name=spring-data-rest " + "-Dartifactory.build-number=${BUILD_NUMBER} " + - '-Dmaven.test.skip=true clean deploy -U -B' + "-Dmaven.test.skip=true clean deploy -U -B" } } } diff --git a/ci/pipeline.properties b/ci/pipeline.properties index 3f58111a7..25c934a51 100644 --- a/ci/pipeline.properties +++ b/ci/pipeline.properties @@ -25,3 +25,6 @@ docker.java.inside.docker=-u root -v /var/run/docker.sock:/var/run/docker.sock - docker.registry= docker.credentials=hub.docker.com-springbuildmaster artifactory.credentials=02bd1690-b54f-4c9f-819d-a77cb7a9822c +artifactory.url=https://repo.spring.io +artifactory.repository.snapshot=libs-snapshot-local +jenkins.user.name=spring-builds+jenkins