diff --git a/Jenkinsfile b/Jenkinsfile index 557b15da9..60b913da1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -8,6 +8,7 @@ pipeline { options { disableConcurrentBuilds() + buildDiscarder(logRotator(numToKeepStr: '14')) } stages { @@ -18,7 +19,7 @@ pipeline { changeset "Makefile" } } - agent any + agent { label 'data' } options { timeout(time: 20, unit: 'MINUTES') } steps { @@ -43,7 +44,8 @@ pipeline { agent { docker { image 'springci/spring-data-openjdk8-with-redis-5.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') } @@ -57,7 +59,7 @@ pipeline { sh 'make start' // Execute maven test - sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/spring-data-maven-repository" ./mvnw clean test -DrunLongTests=true -B' + sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw clean test -DrunLongTests=true -B' // Capture resulting exit code from maven (pass/fail) sh 'RESULT=\$?' @@ -81,7 +83,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') } @@ -92,7 +95,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-redis " + + "-Dartifactory.build-number=${BUILD_NUMBER} " + + '-Dmaven.test.skip=true clean deploy -B' } } @@ -103,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') } @@ -114,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-redis " + + "-Dartifactory.build-number=${BUILD_NUMBER} " + + '-Dmaven.test.skip=true clean deploy -B' } } } diff --git a/pom.xml b/pom.xml index 9d60cefa3..18ef40a8d 100644 --- a/pom.xml +++ b/pom.xml @@ -291,46 +291,6 @@ - - snapshot - - - - org.jfrog.buildinfo - artifactory-maven-plugin - 2.6.1 - false - - - build-info - - publish - - - - {{BUILD_URL}} - - - spring-data-redis - spring-data-redis - false - *:*:*:*@zip - - - https://repo.spring.io - {{ARTIFACTORY_USR}} - {{ARTIFACTORY_PSW}} - libs-snapshot-local - libs-snapshot-local - - - - - - - - - release