Abort building TCK earlier in the Jenkinsfile
This commit is contained in:
parent
c3610186f8
commit
8503584733
|
@ -6,6 +6,18 @@ if (currentBuild.getBuildCauses().toString().contains('BranchIndexingCause')) {
|
||||||
currentBuild.result = 'NOT_BUILT'
|
currentBuild.result = 'NOT_BUILT'
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
def throttleCount
|
||||||
|
// Don't build the TCK on PRs, unless they use the tck label
|
||||||
|
if ( env.CHANGE_ID != null ) {
|
||||||
|
if ( !pullRequest.labels.contains( 'tck' ) ) {
|
||||||
|
print "INFO: Build skipped because pull request doesn't have 'tck' label"
|
||||||
|
return
|
||||||
|
}
|
||||||
|
throttleCount = 20
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
throttleCount = 1
|
||||||
|
}
|
||||||
|
|
||||||
pipeline {
|
pipeline {
|
||||||
agent {
|
agent {
|
||||||
|
@ -15,7 +27,7 @@ pipeline {
|
||||||
jdk 'OpenJDK 11 Latest'
|
jdk 'OpenJDK 11 Latest'
|
||||||
}
|
}
|
||||||
options {
|
options {
|
||||||
rateLimitBuilds(throttle: [count: 1, durationName: 'day', userBoost: true])
|
rateLimitBuilds(throttle: [count: throttleCount, durationName: 'day', userBoost: true])
|
||||||
buildDiscarder(logRotator(numToKeepStr: '3', artifactNumToKeepStr: '3'))
|
buildDiscarder(logRotator(numToKeepStr: '3', artifactNumToKeepStr: '3'))
|
||||||
disableConcurrentBuilds(abortPrevious: true)
|
disableConcurrentBuilds(abortPrevious: true)
|
||||||
}
|
}
|
||||||
|
@ -29,12 +41,6 @@ pipeline {
|
||||||
stage('Build') {
|
stage('Build') {
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
// Don't build the TCK on PRs, unless they use the tck label
|
|
||||||
if ( env.CHANGE_ID && !pullRequest.labels.contains( 'tck' ) ) {
|
|
||||||
print "INFO: Build skipped because pull request doesn't have 'tck' label"
|
|
||||||
currentBuild.result = 'NOT_BUILT'
|
|
||||||
return
|
|
||||||
}
|
|
||||||
docker.withRegistry('https://index.docker.io/v1/', 'hibernateci.hub.docker.com') {
|
docker.withRegistry('https://index.docker.io/v1/', 'hibernateci.hub.docker.com') {
|
||||||
docker.image('openjdk:11-jdk').pull()
|
docker.image('openjdk:11-jdk').pull()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue