Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jobs/build: Add a release lock to the job #581

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion jobs/build.Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,18 @@ def pod_label = "cosa-${UUID.randomUUID().toString()}"
echo "Waiting for build-${params.STREAM} lock"
currentBuild.description = "[${params.STREAM}] Waiting"

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

podTemplate(cloud: 'openshift', label: pod_label, yaml: pod) {
Expand Down Expand Up @@ -746,4 +757,4 @@ lock(resource: "build-${params.STREAM}") {
}
}
}}
}}
}}}