From d5b1a0ea75d99da75d6f1fbfd439462d1ca1827e Mon Sep 17 00:00:00 2001 From: Dusty Mabe Date: Fri, 31 Mar 2023 21:08:00 -0400 Subject: [PATCH] jobs/kola-upgrade: set `target_version` based on target stream Since we can have a different start stream versus target stream, here we need to pick up the target version from the target stream's `builds.json`, not the start stream's `builds.json`. --- jobs/kola-upgrade.Jenkinsfile | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/jobs/kola-upgrade.Jenkinsfile b/jobs/kola-upgrade.Jenkinsfile index 8acdab8fa..21670a292 100644 --- a/jobs/kola-upgrade.Jenkinsfile +++ b/jobs/kola-upgrade.Jenkinsfile @@ -82,6 +82,15 @@ lock(resource: "kola-upgrade-${params.ARCH}") { timeout(time: 90, unit: 'MINUTES') { try { + // Determine the target version. If no params.TARGET_VERSION was + // specified then it will be the latest in the params.STREAM. + if (target_version == '') { + target_version = shwrapCapture(""" + curl -L https://builds.coreos.fedoraproject.org/prod/streams/${params.STREAM}/builds/builds.json | \ + jq -r .builds[0].id + """) + } + echo "Selected ${target_version} as the target version to test" // Determine the start version based on the provided params.START_VERSION // and the releases.json for this stream. The user can provide a full // version, the empty string (implies earliest available), or two digits @@ -143,12 +152,6 @@ lock(resource: "kola-upgrade-${params.ARCH}") { cosa buildfetch --artifact=qemu --stream=${start_stream} --build=${start_version} --arch=${params.ARCH} cosa decompress --build=${start_version} """) - - // If no target version was specified the target will be the latest build - if (target_version == '') { - target_version = shwrapCapture("cosa shell -- jq -r .builds[0].id builds/builds.json") - currentBuild.description = "[${params.STREAM}][${params.ARCH}] - ${start_version}->${target_version}" - } } // A few independent tasks that can be run in parallel