@@ -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 }
@@ -42,8 +43,9 @@ pipeline {
4243
4344 stage(" Test other configurations" ) {
4445 when {
46+ beforeAgent(true )
4547 allOf {
46- branch ' main'
48+ branch( pattern : " main|( \\ d \\ . \\ d \\ .x) " , comparator : " REGEXP " )
4749 not { triggeredBy ' UpstreamCause' }
4850 }
4951 }
@@ -90,8 +92,9 @@ pipeline {
9092
9193 stage(' Release to artifactory' ) {
9294 when {
95+ beforeAgent(true )
9396 anyOf {
94- branch ' main'
97+ branch( pattern : " main|( \\ d \\ . \\ d \\ .x) " , comparator : " REGEXP " )
9598 not { triggeredBy ' UpstreamCause' }
9699 }
97100 }
@@ -121,34 +124,6 @@ pipeline {
121124 }
122125 }
123126 }
124- stage(' Publish documentation' ) {
125- when {
126- branch ' main'
127- }
128- agent {
129- label ' data'
130- }
131- options { timeout(time : 20 , unit : ' MINUTES' ) }
132-
133- environment {
134- ARTIFACTORY = credentials(' 02bd1690-b54f-4c9f-819d-a77cb7a9822c' )
135- }
136-
137- steps {
138- script {
139- docker. withRegistry(' ' , ' hub.docker.com-springbuildmaster' ) {
140- docker. image(' adoptopenjdk/openjdk8:latest' ). inside(' -v $HOME:/tmp/jenkins-home' ) {
141- sh ' MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -s settings.xml -Pci,distribute ' +
142- ' -Dartifactory.server=https://repo.spring.io ' +
143- " -Dartifactory.username=${ ARTIFACTORY_USR} " +
144- " -Dartifactory.password=${ ARTIFACTORY_PSW} " +
145- " -Dartifactory.distribution-repository=temp-private-local " +
146- ' -Dmaven.test.skip=true clean deploy -U -B'
147- }
148- }
149- }
150- }
151- }
152127 }
153128
154129 post {
0 commit comments