diff --git a/Jenkinsfile b/Jenkinsfile index 54ad1a5b..3b015b0e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,81 +11,69 @@ pipeline { buildDiscarder(logRotator(numToKeepStr: '14')) } - stages { - stage("Test") { - parallel { - stage("test: baseline") { - agent { - docker { - image 'adoptopenjdk/openjdk8:latest' - label 'data' - args '-v $HOME:/tmp/jenkins-home' - } - } - options { timeout(time: 30, unit: 'MINUTES') } - steps { - sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw clean dependency:list verify -Dsort -B' - } - } - } - } - stage('Release to artifactory') { - when { - branch 'issue/*' - } - agent { - docker { - image 'adoptopenjdk/openjdk8:latest' - label 'data' - args '-v $HOME:/tmp/jenkins-home' - } - } - options { timeout(time: 20, unit: 'MINUTES') } + stages { + stage("Test") { + when { + anyOf { + branch '1.9.x' + not { triggeredBy 'UpstreamCause' } + } + } + parallel { + stage("test: baseline") { + agent { + docker { + image 'adoptopenjdk/openjdk8:latest' + label 'data' + args '-v $HOME:/tmp/jenkins-home' + } + } + options { timeout(time: 30, unit: 'MINUTES') } + steps { + sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw clean dependency:list verify -Dsort -B' + } + } + } + } + stage('Build project & BOM then release to artifactory') { + when { + anyOf { + branch '1.9.x' + not { triggeredBy 'UpstreamCause' } + } + } + agent { + docker { + image 'adoptopenjdk/openjdk8:latest' + label 'data' + args '-v $HOME:/tmp/jenkins-home' + } + } + options { timeout(time: 20, unit: 'MINUTES') } environment { ARTIFACTORY = credentials('02bd1690-b54f-4c9f-819d-a77cb7a9822c') } - steps { - 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-build-1.9 " + - "-Dartifactory.build-number=${BUILD_NUMBER} " + - '-Dmaven.test.skip=true clean deploy -B' - } - } - stage('Release to artifactory with docs') { - when { - branch '1.9.x' - } - agent { - docker { - image 'adoptopenjdk/openjdk8:latest' - label 'data' - args '-v $HOME:/tmp/jenkins-home' - } - } - options { timeout(time: 20, unit: 'MINUTES') } + steps { + sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ' + + './mvnw clean dependency:tree source:jar javadoc:javadoc javadoc:jar install -pl "!bom" -B -U ' - environment { - ARTIFACTORY = credentials('02bd1690-b54f-4c9f-819d-a77cb7a9822c') - } + sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw clean install -pl bom -B -U' - steps { - 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-build-1.9 " + - "-Dartifactory.build-number=${BUILD_NUMBER} " + - '-Dmaven.test.skip=true clean deploy -B' - } - } - } + sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pwith-bom-client verify -pl bom-client -B -U' + + 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-build-1.9 " + + "-Dartifactory.build-number=${BUILD_NUMBER} " + + '-Dmaven.test.skip=true clean deploy -B' + } + } + } post { changed { diff --git a/pom.xml b/pom.xml index 1dddd2bc..ba51041a 100644 --- a/pom.xml +++ b/pom.xml @@ -161,6 +161,14 @@ + + with-bom-client + + + bom-client + + +