Skip to content

Commit be31122

Browse files
committed
jobs/build: Add a release lock to the job
We're hitting a subtle issue here where newer x86_64 pipelines are running (and early uploading their builds.json) before the release job runs for the previous build. That release job then fails. This commit adds a new lock to try to prevent newer x86_64 (main) pipeline jobs from running before the fleet of jobs from the previous run are complete.
1 parent fc35327 commit be31122

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

jobs/build.Jenkinsfile

+12-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,18 @@ def pod_label = "cosa-${UUID.randomUUID().toString()}"
117117
echo "Waiting for build-${params.STREAM} lock"
118118
currentBuild.description = "[${params.STREAM}] Waiting"
119119

120+
// build lock: we don't want multiple concurrent builds for the same
121+
// stream. This one goes first to make sure the release
122+
// lock isn't attempted to be acquired until the previous
123+
// build is done (and the previous build release job has
124+
// already been kicked off and release lock taken by it).
125+
// release lock: we want to block future runs until the release job
126+
// for this build (which gets started at the end of this
127+
// build) is done. i.e. we don't want new x86_64 runs to
128+
// start before the multi-arch jobs and the release job
129+
// are done.
120130
lock(resource: "build-${params.STREAM}") {
131+
lock(resource: "release-${params.STREAM}") {
121132
currentBuild.description = "[${params.STREAM}] Running"
122133

123134
podTemplate(cloud: 'openshift', label: pod_label, yaml: pod) {
@@ -746,4 +757,4 @@ lock(resource: "build-${params.STREAM}") {
746757
}
747758
}
748759
}}
749-
}}
760+
}}}

0 commit comments

Comments
 (0)