Skip to content

Commit d61dbe0

Browse files
marko-bekhtabeikov
authored andcommitted
Do not run the Jenkinsfile build (main/tck) on push to the branch
1 parent 21be5cf commit d61dbe0

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

Jenkinsfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,12 @@ if (currentBuild.getBuildCauses().toString().contains('BranchIndexingCause')) {
9595
currentBuild.result = 'NOT_BUILT'
9696
return
9797
}
98+
// This is a limited maintenance branch, so don't run this on pushes to the branch, only on PRs
99+
if ( !env.CHANGE_ID ) {
100+
print "INFO: Build skipped because this job should only run for pull request, not for branch pushes"
101+
currentBuild.result = 'NOT_BUILT'
102+
return
103+
}
98104

99105
stage('Build') {
100106
Map<String, Closure> executions = [:]

ci/jpa-3.2-tck.Jenkinsfile

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,11 @@ if (currentBuild.getBuildCauses().toString().contains('BranchIndexingCause')) {
66
currentBuild.result = 'NOT_BUILT'
77
return
88
}
9-
def throttleCount
10-
// Don't build the TCK on PRs, unless they use the tck label
11-
if ( env.CHANGE_ID != null ) {
12-
if ( !pullRequest.labels.contains( 'tck' ) ) {
13-
print "INFO: Build skipped because pull request doesn't have 'tck' label"
14-
return
15-
}
16-
throttleCount = 20
17-
}
18-
else {
19-
throttleCount = 1
9+
// This is a limited maintenance branch, so don't run this on pushes to the branch, only on PRs
10+
if ( !env.CHANGE_ID ) {
11+
print "INFO: Build skipped because this job should only run for pull request, not for branch pushes"
12+
currentBuild.result = 'NOT_BUILT'
13+
return
2014
}
2115

2216
pipeline {
@@ -25,7 +19,6 @@ pipeline {
2519
jdk 'OpenJDK 17 Latest'
2620
}
2721
options {
28-
rateLimitBuilds(throttle: [count: throttleCount, durationName: 'day', userBoost: true])
2922
buildDiscarder(logRotator(numToKeepStr: '3', artifactNumToKeepStr: '3'))
3023
disableConcurrentBuilds(abortPrevious: true)
3124
}

0 commit comments

Comments
 (0)