Merge pull request #39863 from psftw/milestone-hack

Jenkinsfile hack for auto-cancellation.
This commit is contained in:
Kirill Kolyshkin 2019-09-04 16:38:04 +03:00 committed by GitHub
commit 714e0bfbbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 1 deletions

13
Jenkinsfile vendored
View File

@ -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 \