diff --git a/Jenkinsfile b/Jenkinsfile index 6395f1c49..8ab231999 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,7 +9,7 @@ pipeline { triggers { pollSCM 'H/10 * * * *' - upstream(upstreamProjects: "spring-data-commons/3.0.x", threshold: hudson.model.Result.SUCCESS) + upstream(upstreamProjects: "spring-data-commons/main", threshold: hudson.model.Result.SUCCESS) } options { @@ -20,8 +20,9 @@ pipeline { stages { stage("test: baseline (Java 17)") { when { + beforeAgent(true) anyOf { - branch 'main' + branch(pattern: "main|(\\d\\.\\d\\.x)", comparator: "REGEXP") not { triggeredBy 'UpstreamCause' } } } @@ -48,68 +49,11 @@ pipeline { } } - stage("Test other configurations") { - when { - allOf { - branch 'main' - not { triggeredBy 'UpstreamCause' } - } - } - parallel { - stage("test: baseline (next)") { - agent { - label 'data' - } - options { timeout(time: 30, unit: 'MINUTES') } - - environment { - DOCKER_HUB = credentials("${p['docker.credentials']}") - ARTIFACTORY = credentials("${p['artifactory.credentials']}") - } - - steps { - script { - docker.withRegistry(p['docker.registry'], p['docker.credentials']) { - docker.image(p['docker.java.next.image']).inside(p['docker.java.inside.docker']) { - sh "docker login --username ${DOCKER_HUB_USR} --password ${DOCKER_HUB_PSW}" - sh 'PROFILE=none ci/verify.sh' - sh "ci/clean.sh" - } - } - } - } - } - - stage("test: baseline (LTS)") { - agent { - label 'data' - } - options { timeout(time: 30, unit: 'MINUTES') } - - environment { - DOCKER_HUB = credentials("${p['docker.credentials']}") - ARTIFACTORY = credentials("${p['artifactory.credentials']}") - } - - steps { - script { - docker.withRegistry(p['docker.registry'], p['docker.credentials']) { - docker.image(p['docker.java.lts.image']).inside(p['docker.java.inside.docker']) { - sh "docker login --username ${DOCKER_HUB_USR} --password ${DOCKER_HUB_PSW}" - sh 'PROFILE=none ci/verify.sh' - sh "ci/clean.sh" - } - } - } - } - } - } - } - stage('Release to artifactory') { when { + beforeAgent(true) anyOf { - branch 'main' + branch(pattern: "main|(\\d\\.\\d\\.x)", comparator: "REGEXP") not { triggeredBy 'UpstreamCause' } } } @@ -139,34 +83,6 @@ pipeline { } } } - stage('Publish documentation') { - when { - branch 'main' - } - agent { - label 'data' - } - options { timeout(time: 20, unit: 'MINUTES') } - - environment { - ARTIFACTORY = credentials('02bd1690-b54f-4c9f-819d-a77cb7a9822c') - } - - steps { - script { - docker.withRegistry('', 'hub.docker.com-springbuildmaster') { - 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,distribute -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-elasticsearch-non-root ' + - '-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' - } - } - } - } - } } post {