diff --git a/Jenkinsfile b/Jenkinsfile index a7878d939..1d9b86c59 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -8,6 +8,7 @@ pipeline { options { disableConcurrentBuilds() + buildDiscarder(logRotator(numToKeepStr: '14')) } stages { @@ -17,7 +18,7 @@ pipeline { when { changeset "ci/openjdk8-mongodb-4.0/**" } - agent any + agent { label 'data' } options { timeout(time: 30, unit: 'MINUTES') } steps { @@ -33,7 +34,7 @@ pipeline { when { changeset "ci/openjdk8-mongodb-4.1/**" } - agent any + agent { label 'data' } options { timeout(time: 30, unit: 'MINUTES') } steps { @@ -58,7 +59,8 @@ pipeline { agent { docker { image 'springci/spring-data-openjdk8-with-mongodb-4.0:latest' - args '-v $HOME/.m2:/tmp/spring-data-maven-repository' + label 'data' + args '-v $HOME:/tmp/jenkins-home' } } options { timeout(time: 30, unit: 'MINUTES') } @@ -69,7 +71,7 @@ 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/spring-data-maven-repository" ./mvnw clean dependency:list test -Dsort -B' + sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw clean dependency:list test -Dsort -B' } } @@ -84,9 +86,9 @@ pipeline { stage("test: mongodb 4.1") { agent { docker { - label 'data' image 'springci/spring-data-openjdk8-with-mongodb-4.1:latest' - args '-v $HOME/.m2:/tmp/spring-data-maven-repository' + label 'data' + args '-v $HOME:/tmp/jenkins-home' } } options { timeout(time: 30, unit: 'MINUTES') } @@ -97,7 +99,7 @@ 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/spring-data-maven-repository" ./mvnw clean dependency:list test -Dsort -B' + sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw clean dependency:list test -Dsort -B' } } } @@ -111,7 +113,8 @@ pipeline { agent { docker { image 'adoptopenjdk/openjdk8:latest' - args '-v $HOME/.m2:/tmp/spring-data-maven-repository' + label 'data' + args '-v $HOME:/tmp/jenkins-home' } } options { timeout(time: 20, unit: 'MINUTES') } @@ -122,7 +125,14 @@ pipeline { steps { sh 'rm -rf ?' - sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/spring-data-maven-repository" ./mvnw -Pci,snapshot -Dmaven.test.skip=true clean deploy -B' + 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-mongodb " + + "-Dartifactory.build-number=${BUILD_NUMBER} " + + '-Dmaven.test.skip=true clean deploy -B' } } @@ -133,7 +143,8 @@ pipeline { agent { docker { image 'adoptopenjdk/openjdk8:latest' - args '-v $HOME/.m2:/tmp/spring-data-maven-repository' + label 'data' + args '-v $HOME:/tmp/jenkins-home' } } options { timeout(time: 20, unit: 'MINUTES') } @@ -144,7 +155,14 @@ pipeline { steps { sh 'rm -rf ?' - sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/spring-data-maven-repository" ./mvnw -Pci,snapshot -Dmaven.test.skip=true clean deploy -B' + 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-mongodb " + + "-Dartifactory.build-number=${BUILD_NUMBER} " + + '-Dmaven.test.skip=true clean deploy -B' } } } diff --git a/pom.xml b/pom.xml index 4aacfba02..e43742d5a 100644 --- a/pom.xml +++ b/pom.xml @@ -114,46 +114,6 @@ - - snapshot - - - - org.jfrog.buildinfo - artifactory-maven-plugin - 2.6.1 - false - - - build-info - - publish - - - - {{BUILD_URL}} - - - spring-data-mongodb - spring-data-mongodb - false - *:*:*:*@zip - - - https://repo.spring.io - {{ARTIFACTORY_USR}} - {{ARTIFACTORY_PSW}} - libs-snapshot-local - libs-snapshot-local - - - - - - - - - release