diff --git a/Jenkinsfile b/Jenkinsfile index 446acab25..b575de171 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -21,21 +21,22 @@ pipeline { } } agent { - docker { - image 'springci/spring-data-openjdk8-with-mongodb-4.2.0:latest' - label 'data' - args '-v $HOME:/tmp/jenkins-home' - } + label 'data' } options { timeout(time: 30, unit: 'MINUTES') } steps { - sh 'rm -rf ?' - sh 'mkdir -p /tmp/mongodb/db /tmp/mongodb/log' - sh 'mongod --dbpath /tmp/mongodb/db --replSet rs0 --fork --logpath /tmp/mongodb/log/mongod.log &' - 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 clean dependency:list test -Dsort -U -B -Pit' + script { + docker.withRegistry('', 'hub.docker.com-springbuildmaster') { + docker.image('springci/spring-data-openjdk8-with-mongodb-4.2.0:latest').inside('-v $HOME:/tmp/jenkins-home') { + sh 'mkdir -p /tmp/mongodb/db /tmp/mongodb/log' + sh 'mongod --dbpath /tmp/mongodb/db --replSet rs0 --fork --logpath /tmp/mongodb/log/mongod.log &' + 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 clean dependency:list test -Dsort -U -B -Pit' + } + } + } } } @@ -47,11 +48,7 @@ pipeline { } } agent { - docker { - image 'adoptopenjdk/openjdk8:latest' - label 'data' - args '-v $HOME:/tmp/jenkins-home' - } + label 'data' } options { timeout(time: 20, unit: 'MINUTES') } @@ -60,15 +57,20 @@ pipeline { } steps { - sh 'rm -rf ?' - sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,artifactory ' + - '-Dartifactory.server=https://repo.spring.io ' + - "-Dartifactory.username=${ARTIFACTORY_USR} " + - "-Dartifactory.password=${ARTIFACTORY_PSW} " + - "-Dartifactory.staging-repository=libs-snapshot-local " + - "-Dartifactory.build-name=spring-data-rest " + - "-Dartifactory.build-number=${BUILD_NUMBER} " + - '-Dmaven.test.skip=true clean deploy -U -B' + script { + docker.withRegistry('', 'hub.docker.com-springbuildmaster') { + docker.image('adoptopenjdk/openjdk8:latest').inside('-v $HOME:/tmp/jenkins-home') { + sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,artifactory ' + + '-Dartifactory.server=https://repo.spring.io ' + + "-Dartifactory.username=${ARTIFACTORY_USR} " + + "-Dartifactory.password=${ARTIFACTORY_PSW} " + + "-Dartifactory.staging-repository=libs-snapshot-local " + + "-Dartifactory.build-name=spring-data-rest " + + "-Dartifactory.build-number=${BUILD_NUMBER} " + + '-Dmaven.test.skip=true clean deploy -U -B' + } + } + } } } stage('Publish documentation') { @@ -76,11 +78,7 @@ pipeline { branch '3.2.x' } agent { - docker { - image 'adoptopenjdk/openjdk8:latest' - label 'data' - args '-v $HOME:/tmp/jenkins-home' - } + label 'data' } options { timeout(time: 20, unit: 'MINUTES') } @@ -89,12 +87,18 @@ pipeline { } steps { - sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,distribute ' + - '-Dartifactory.server=https://repo.spring.io ' + - "-Dartifactory.username=${ARTIFACTORY_USR} " + - "-Dartifactory.password=${ARTIFACTORY_PSW} " + - "-Dartifactory.distribution-repository=temp-private-local " + - '-Dmaven.test.skip=true clean deploy -U -B' + script { + docker.withRegistry('', 'hub.docker.com-springbuildmaster') { + docker.image('adoptopenjdk/openjdk8:latest').inside('-v $HOME:/tmp/jenkins-home') { + sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,distribute ' + + '-Dartifactory.server=https://repo.spring.io ' + + "-Dartifactory.username=${ARTIFACTORY_USR} " + + "-Dartifactory.password=${ARTIFACTORY_PSW} " + + "-Dartifactory.distribution-repository=temp-private-local " + + '-Dmaven.test.skip=true clean deploy -U -B' + } + } + } } } } diff --git a/pom.xml b/pom.xml index afe25d5fc..7bc9aa8b2 100644 --- a/pom.xml +++ b/pom.xml @@ -140,6 +140,11 @@ spring-plugins-release https://repo.spring.io/plugins-release + + bintray-plugins + bintray-plugins + https://jcenter.bintray.com +