Skip to content

Commit

Permalink
jobs/build: gate all rerun logic on uploading
Browse files Browse the repository at this point in the history
We only actually run the jobs when `uploading` is set. So it seems wrong
to update the build description. In fact, let's not even waste time
looking for missing arches or reading build metadata.

Patch best viewed with whitespace ignored.
  • Loading branch information
jlebon committed Feb 23, 2023
1 parent b813111 commit c2ad35d
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions jobs/build.Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -265,15 +265,16 @@ lock(resource: "build-${params.STREAM}") {
// Nothing changed since the latest build. Check if it's missing
// some arches and retrigger `build-arch` only for the missing
// arches, and the follow-up `release` job. Match the exact src
// config commit that was used.
def builds = readJSON file: "builds/builds.json"
assert buildID == builds.builds[0].id
def missing_arches = additional_arches - builds.builds[0].arches
if (missing_arches) {
def meta = readJSON(text: shwrapCapture("cosa meta --build=${buildID} --dump"))
def rev = meta["coreos-assembler.config-gitrev"]
currentBuild.description = "${build_description} 🔨 ${buildID}"
if (uploading) {
// config commit that was used. Skip if not uploading since it's
// required for multi-arch.
if (uploading) {
def builds = readJSON file: "builds/builds.json"
assert buildID == builds.builds[0].id
def missing_arches = additional_arches - builds.builds[0].arches
if (missing_arches) {
def meta = readJSON(text: shwrapCapture("cosa meta --build=${buildID} --dump"))
def rev = meta["coreos-assembler.config-gitrev"]
currentBuild.description = "${build_description} 🔨 ${buildID}"
// Run the mArch jobs and wait. We wait here because if they fail
// we don't want to bother running the release job again since the
// goal is to get a complete build.
Expand Down

0 comments on commit c2ad35d

Please sign in to comment.