ci: cancel previous build on PR update
authorJonathan Lebon <jonathan@jlebon.com>
Tue, 21 Nov 2023 20:31:38 +0000 (15:31 -0500)
committerJonathan Lebon <jonathan@jlebon.com>
Tue, 21 Nov 2023 20:33:20 +0000 (15:33 -0500)
This is an easy way to save CI resources; when a PR is updated, abort
any previous build for that PR to focus on testing the latest push.

.cci.jenkinsfile

index 82e2d1ac845a10aecba656bf38f14c6826daf011..1f41be1a1920a118c5390ca4b5e6123daf0df98f 100644 (file)
@@ -1,5 +1,10 @@
 // Documentation: https://github.com/coreos/coreos-ci/blob/main/README-upstream-ci.md
 
+properties([
+  // abort previous runs when a PR is updated to save resources
+  disableConcurrentBuilds(abortPrevious: true)
+])
+
 stage("Build") {
   def n = 5
   buildPod(memory: "2Gi", cpu: "${n}") {