From 8c457a2495b5ddc114e126f91f6cb3073334d616 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Wed, 21 Sep 2022 12:06:45 +0200 Subject: [PATCH] ci: abort old PR builds to make queue shorter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In most cases developers only care about the most recent version. Signed-off-by: Jakub SokoĊ‚owski --- ci/Jenkinsfile.linux | 7 +++++++ ci/Jenkinsfile.linux-cpp | 7 +++++++ ci/Jenkinsfile.macos | 7 +++++++ ci/Jenkinsfile.macos-cpp.todo | 7 +++++++ ci/Jenkinsfile.uitests | 7 +++++++ ci/Jenkinsfile.windows | 7 +++++++ ci/Jenkinsfile.windows-cpp.todo | 7 +++++++ 7 files changed, 49 insertions(+) diff --git a/ci/Jenkinsfile.linux b/ci/Jenkinsfile.linux index 5c3e5e9b48..ed585dc2b6 100644 --- a/ci/Jenkinsfile.linux +++ b/ci/Jenkinsfile.linux @@ -1,5 +1,8 @@ library 'status-jenkins-lib@v1.5.6' +/* Options section can't access functions in objects. */ +def isPRBuild = utils.isPRBuild() + pipeline { agent { docker { @@ -33,6 +36,10 @@ pipeline { daysToKeepStr: '30', artifactNumToKeepStr: '3', )) + /* Abort old PR builds. */ + disableConcurrentBuilds( + abortPrevious: isPRBuild + ) } environment { diff --git a/ci/Jenkinsfile.linux-cpp b/ci/Jenkinsfile.linux-cpp index 75fee004df..0e52c118ef 100644 --- a/ci/Jenkinsfile.linux-cpp +++ b/ci/Jenkinsfile.linux-cpp @@ -1,5 +1,8 @@ library 'status-jenkins-lib@v1.5.6' +/* Options section can't access functions in objects. */ +def isPRBuild = utils.isPRBuild() + pipeline { agent { dockerfile { @@ -29,6 +32,10 @@ pipeline { daysToKeepStr: '30', artifactNumToKeepStr: '3', )) + /* Abort old PR builds. */ + disableConcurrentBuilds( + abortPrevious: isPRBuild + ) } environment { diff --git a/ci/Jenkinsfile.macos b/ci/Jenkinsfile.macos index 314eef5b37..4fcf987db9 100644 --- a/ci/Jenkinsfile.macos +++ b/ci/Jenkinsfile.macos @@ -1,5 +1,8 @@ library 'status-jenkins-lib@v1.5.6' +/* Options section can't access functions in objects. */ +def isPRBuild = utils.isPRBuild() + pipeline { agent { label 'macos && x86_64' @@ -28,6 +31,10 @@ pipeline { daysToKeepStr: '30', artifactNumToKeepStr: '3', )) + /* Abort old PR builds. */ + disableConcurrentBuilds( + abortPrevious: isPRBuild + ) } environment { diff --git a/ci/Jenkinsfile.macos-cpp.todo b/ci/Jenkinsfile.macos-cpp.todo index 7e8c16caa7..d75d2d4589 100644 --- a/ci/Jenkinsfile.macos-cpp.todo +++ b/ci/Jenkinsfile.macos-cpp.todo @@ -1,5 +1,8 @@ library 'status-jenkins-lib@v1.5.6' +/* Options section can't access functions in objects. */ +def isPRBuild = utils.isPRBuild() + pipeline { agent { docker { @@ -26,6 +29,10 @@ pipeline { daysToKeepStr: '30', artifactNumToKeepStr: '3', )) + /* Abort old PR builds. */ + disableConcurrentBuilds( + abortPrevious: isPRBuild + ) } environment { diff --git a/ci/Jenkinsfile.uitests b/ci/Jenkinsfile.uitests index 0b8d58455f..318e9189ab 100644 --- a/ci/Jenkinsfile.uitests +++ b/ci/Jenkinsfile.uitests @@ -1,5 +1,8 @@ library 'status-jenkins-lib@v1.5.1' +/* Options section can't access functions in objects. */ +def isPRBuild = utils.isPRBuild() + pipeline { agent { label 'linux' } @@ -34,6 +37,10 @@ pipeline { maxConcurrentPerNode: 1, maxConcurrentTotal: 1 ) + /* Abort old PR builds. */ + disableConcurrentBuilds( + abortPrevious: isPRBuild + ) } environment { diff --git a/ci/Jenkinsfile.windows b/ci/Jenkinsfile.windows index c1ce1edf2f..e230f906ec 100644 --- a/ci/Jenkinsfile.windows +++ b/ci/Jenkinsfile.windows @@ -1,5 +1,8 @@ library 'status-jenkins-lib@v1.5.6' +/* Options section can't access functions in objects. */ +def isPRBuild = utils.isPRBuild() + pipeline { agent { label 'windows' } @@ -26,6 +29,10 @@ pipeline { daysToKeepStr: '30', artifactNumToKeepStr: '3', )) + /* Abort old PR builds. */ + disableConcurrentBuilds( + abortPrevious: isPRBuild + ) } environment { diff --git a/ci/Jenkinsfile.windows-cpp.todo b/ci/Jenkinsfile.windows-cpp.todo index 67920d9596..b7797f6974 100644 --- a/ci/Jenkinsfile.windows-cpp.todo +++ b/ci/Jenkinsfile.windows-cpp.todo @@ -1,5 +1,8 @@ library 'status-jenkins-lib@v1.5.6' +/* Options section can't access functions in objects. */ +def isPRBuild = utils.isPRBuild() + pipeline { agent { docker { @@ -26,6 +29,10 @@ pipeline { daysToKeepStr: '30', artifactNumToKeepStr: '3', )) + /* Abort old PR builds. */ + disableConcurrentBuilds( + abortPrevious: isPRBuild + ) } environment {