mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Jenkinsfile hack for auto-cancellation.
This change will cause Jenkins to only build the latest HEAD of a PR branch, cancelling any previous builds that may already be in progress. This will decrease feedback time and help mitigate resource contention. Signed-off-by: Peter Salvatore <peter@psftw.com>
This commit is contained in:
parent
f505abb6a7
commit
85bcc524ea
1 changed files with 12 additions and 1 deletions
13
Jenkinsfile
vendored
13
Jenkinsfile
vendored
|
@ -25,12 +25,23 @@ pipeline {
|
|||
TIMEOUT = '120m'
|
||||
}
|
||||
stages {
|
||||
stage('pr-hack') {
|
||||
when { changeRequest() }
|
||||
steps {
|
||||
script {
|
||||
echo "Workaround for PR auto-cancel feature. Borrowed from https://issues.jenkins-ci.org/browse/JENKINS-43353"
|
||||
def buildNumber = env.BUILD_NUMBER as int
|
||||
if (buildNumber > 1) milestone(buildNumber - 1)
|
||||
milestone(buildNumber)
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('DCO-check') {
|
||||
when {
|
||||
beforeAgent true
|
||||
expression { !params.skip_dco }
|
||||
}
|
||||
agent { label 'linux' }
|
||||
agent { label 'amd64 && ubuntu-1804 && overlay2' }
|
||||
steps {
|
||||
sh '''
|
||||
docker run --rm \
|
||||
|
|
Loading…
Reference in a new issue