Skip to content

Commit 9e2f605

Browse files
christophstroblmp911de
authored andcommitted
Refine CI job triggers.
See #3696 Original pull request: #3753.
1 parent 7f58538 commit 9e2f605

File tree

1 file changed

+6
-32
lines changed

1 file changed

+6
-32
lines changed

Jenkinsfile

Lines changed: 6 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,9 @@ pipeline {
8383

8484
stage("test: baseline (jdk8)") {
8585
when {
86+
beforeAgent(true)
8687
anyOf {
87-
branch 'main'
88+
branch(pattern: "main|(\\d\\.\\d\\.x)", comparator: "REGEXP")
8889
not { triggeredBy 'UpstreamCause' }
8990
}
9091
}
@@ -113,8 +114,9 @@ pipeline {
113114

114115
stage("Test other configurations") {
115116
when {
117+
beforeAgent(true)
116118
allOf {
117-
branch 'main'
119+
branch(pattern: "main|(\\d\\.\\d\\.x)", comparator: "REGEXP")
118120
not { triggeredBy 'UpstreamCause' }
119121
}
120122
}
@@ -219,8 +221,9 @@ pipeline {
219221

220222
stage('Release to artifactory') {
221223
when {
224+
beforeAgent(true)
222225
anyOf {
223-
branch 'main'
226+
branch(pattern: "main|(\\d\\.\\d\\.x)", comparator: "REGEXP")
224227
not { triggeredBy 'UpstreamCause' }
225228
}
226229
}
@@ -250,35 +253,6 @@ pipeline {
250253
}
251254
}
252255
}
253-
254-
stage('Publish documentation') {
255-
when {
256-
branch 'main'
257-
}
258-
agent {
259-
label 'data'
260-
}
261-
options { timeout(time: 20, unit: 'MINUTES') }
262-
263-
environment {
264-
ARTIFACTORY = credentials('02bd1690-b54f-4c9f-819d-a77cb7a9822c')
265-
}
266-
267-
steps {
268-
script {
269-
docker.withRegistry('', 'hub.docker.com-springbuildmaster') {
270-
docker.image('adoptopenjdk/openjdk8:latest').inside('-v $HOME:/tmp/jenkins-home') {
271-
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -s settings.xml -Pci,distribute ' +
272-
'-Dartifactory.server=https://repo.spring.io ' +
273-
"-Dartifactory.username=${ARTIFACTORY_USR} " +
274-
"-Dartifactory.password=${ARTIFACTORY_PSW} " +
275-
"-Dartifactory.distribution-repository=temp-private-local " +
276-
'-Dmaven.test.skip=true clean deploy -U -B'
277-
}
278-
}
279-
}
280-
}
281-
}
282256
}
283257

284258
post {

0 commit comments

Comments
 (0)