@@ -14,8 +14,9 @@ pipeline {
1414 stages {
1515 stage(" test: baseline (jdk8)" ) {
1616 when {
17+ beforeAgent(true )
1718 anyOf {
18- branch ' main'
19+ branch( pattern : " main|( \\ d \\ . \\ d \\ .x) " , comparator : " REGEXP " )
1920 not { triggeredBy ' UpstreamCause' }
2021 }
2122 }
@@ -44,8 +45,9 @@ pipeline {
4445
4546 stage(" Test other configurations" ) {
4647 when {
48+ beforeAgent(true )
4749 allOf {
48- branch ' main'
50+ branch( pattern : " main|( \\ d \\ . \\ d \\ .x) " , comparator : " REGEXP " )
4951 not { triggeredBy ' UpstreamCause' }
5052 }
5153 }
@@ -102,8 +104,9 @@ pipeline {
102104
103105 stage(' Release to artifactory' ) {
104106 when {
107+ beforeAgent(true )
105108 anyOf {
106- branch ' main'
109+ branch( pattern : " main|( \\ d \\ . \\ d \\ .x) " , comparator : " REGEXP " )
107110 not { triggeredBy ' UpstreamCause' }
108111 }
109112 }
@@ -133,35 +136,6 @@ pipeline {
133136 }
134137 }
135138 }
136-
137- stage(' Publish documentation' ) {
138- when {
139- branch ' main'
140- }
141- agent {
142- label ' data'
143- }
144- options { timeout(time : 20 , unit : ' MINUTES' ) }
145-
146- environment {
147- ARTIFACTORY = credentials(' 02bd1690-b54f-4c9f-819d-a77cb7a9822c' )
148- }
149-
150- steps {
151- script {
152- docker. withRegistry(' ' , ' hub.docker.com-springbuildmaster' ) {
153- docker. image(' adoptopenjdk/openjdk8:latest' ). inside(' -v $HOME:/tmp/jenkins-home' ) {
154- 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-jdbc-non-root ' +
155- ' -Dartifactory.server=https://repo.spring.io ' +
156- " -Dartifactory.username=${ ARTIFACTORY_USR} " +
157- " -Dartifactory.password=${ ARTIFACTORY_PSW} " +
158- " -Dartifactory.distribution-repository=temp-private-local " +
159- ' -Dmaven.test.skip=true clean deploy -U -B'
160- }
161- }
162- }
163- }
164- }
165139 }
166140
167141 post {
0 commit comments