From 6613d40ffb14e86541311fb30ed548985cc4e01e Mon Sep 17 00:00:00 2001 From: Mark Beierl Date: Fri, 16 Sep 2022 16:41:13 -0400 Subject: [PATCH] Workaround for Charmcraft Display Bug https://github.com/canonical/charmcraft/issues/834 The same revision can be displayed more then once, so we just take the first one Change-Id: Idd51d3b439e9c303ba44084c21998fa195aa586e Signed-off-by: Mark Beierl --- jenkins/ci-pipelines/ci_stage_3.groovy | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/jenkins/ci-pipelines/ci_stage_3.groovy b/jenkins/ci-pipelines/ci_stage_3.groovy index d804d06c..9b030163 100644 --- a/jenkins/ci-pipelines/ci_stage_3.groovy +++ b/jenkins/ci-pipelines/ci_stage_3.groovy @@ -699,14 +699,12 @@ EOF""" sh "charmcraft status $charm --format json > ${charm}.json" isCharm = sh(returnStdout: true, script: "grep architecture ${charm}.json | wc -l").trim() as int if (isCharm) { - jqScriptEdge = "cat ${charm}.json | jq -r '.[] | select(.track==\"$channel\") | .mappings[] | select(.base.architecture==\"amd64\" and .base.channel==\"20.04\") | .releases[] | select(.channel==\"latest/edge/merged\")| .version'" - jqScriptBeta = "cat ${charm}.json | jq -r '.[] | select(.track==\"$channel\") | .mappings[] | select(.base.architecture==\"amd64\" and .base.channel==\"20.04\") | .releases[] | select(.channel==\"latest/beta\")| .version'" + jqScriptEdge = "cat ${charm}.json | jq -r '.[] | select(.track==\"$channel\") | .mappings[] | select(.base.architecture==\"amd64\" and .base.channel==\"20.04\") | .releases[] | select(.channel==\"latest/edge/merged\")| .version'|head -1" + jqScriptBeta = "cat ${charm}.json | jq -r '.[] | select(.track==\"$channel\") | .mappings[] | select(.base.architecture==\"amd64\" and .base.channel==\"20.04\") | .releases[] | select(.channel==\"latest/beta\")| .version'|head -1" } else { - jqScriptEdge = "cat ${charm}.json | jq -r '.[] | select(.track==\"$channel\") | .mappings[].releases[] | select(.channel==\"latest/edge/merged\")| .version'" - jqScriptBeta = "cat ${charm}.json | jq -r '.[] | select(.track==\"$channel\") | .mappings[].releases[] | select(.channel==\"latest/beta\")| .version'" + jqScriptEdge = "cat ${charm}.json | jq -r '.[] | select(.track==\"$channel\") | .mappings[].releases[] | select(.channel==\"latest/edge/merged\")| .version'|head -1" + jqScriptBeta = "cat ${charm}.json | jq -r '.[] | select(.track==\"$channel\") | .mappings[].releases[] | select(.channel==\"latest/beta\")| .version'|head -1" } - println(jqScriptEdge) - println(jqScriptBeta) // edge/merged is used in place of /edge as 10.1.0 LTS uses latest/edge edge_rev = sh(returnStdout: true, script: jqScriptEdge).trim() beta_rev = sh(returnStdout: true, script: jqScriptBeta).trim() -- 2.25.1