From 578e542a6637011996166d2628781ce5fc26dc25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Tue, 28 Jun 2022 20:46:54 +0200 Subject: [PATCH] ci: use newly added disableConcurrentBuilds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/jenkinsci/workflow-job-plugin/pull/200 Removes the need to use our own convoluted implementation: https://github.com/status-im/status-jenkins-lib/blob/17c1d0ea/vars/jenkins.groovy#L6-L27 Signed-off-by: Jakub SokoĊ‚owski --- ci/Jenkinsfile.android | 8 +++++++- ci/Jenkinsfile.ios | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ci/Jenkinsfile.android b/ci/Jenkinsfile.android index 7492cc976d..210fbc54bf 100644 --- a/ci/Jenkinsfile.android +++ b/ci/Jenkinsfile.android @@ -1,5 +1,8 @@ library 'status-jenkins-lib@v1.4.3' +/* Options section can't access functions in objects. */ +def isPRBuild = utils.isPRBuild() + pipeline { agent { label 'linux && x86_64 && nix-2.8' } @@ -15,6 +18,10 @@ pipeline { )) /* Allows combined build to copy */ copyArtifactPermission('/status-react/*') + /* Abort old PR builds. */ + disableConcurrentBuilds( + abortPrevious: isPRBuild + ) } parameters { @@ -44,7 +51,6 @@ pipeline { script { btype = utils.getBuildType() print "Running ${btype} build!" - jenkins.abortPreviousRunningBuilds() /* Cleanup and Prep */ commonPrep(btype) } diff --git a/ci/Jenkinsfile.ios b/ci/Jenkinsfile.ios index 873f937a01..8775079bd3 100644 --- a/ci/Jenkinsfile.ios +++ b/ci/Jenkinsfile.ios @@ -1,5 +1,8 @@ library 'status-jenkins-lib@v1.4.3' +/* Options section can't access functions in objects. */ +def isPRBuild = utils.isPRBuild() + pipeline { agent { label 'macos && x86_64 && nix-2.8 && xcode-13.3' } @@ -23,6 +26,10 @@ pipeline { )) /* Allows combined build to copy */ copyArtifactPermission('/status-react/*') + /* Abort old PR builds. */ + disableConcurrentBuilds( + abortPrevious: isPRBuild + ) } environment { @@ -43,7 +50,6 @@ pipeline { script { btype = utils.getBuildType() print "Running ${btype} build!" - jenkins.abortPreviousRunningBuilds() /* Cleanup and Prep */ commonPrep(btype) }