Fixing track 58/12558/1
authorMark Beierl <mark.beierl@canonical.com>
Thu, 22 Sep 2022 14:01:14 +0000 (10:01 -0400)
committerMark Beierl <mark.beierl@canonical.com>
Thu, 22 Sep 2022 14:01:14 +0000 (10:01 -0400)
Use variable instead of hard-coded 'latest'

Change-Id: I72bcf6f0ed7ef84aefde255d6ee877ead86836b6
Signed-off-by: Mark Beierl <mark.beierl@canonical.com>
jenkins/ci-pipelines/ci_stage_3.groovy

index 64584ee..50effe0 100644 (file)
@@ -694,11 +694,11 @@ 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'|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"
+                                        jqScriptEdge = "cat ${charm}.json | jq -r '.[] | select(.track==\"$channel\") | .mappings[] | select(.base.architecture==\"amd64\" and .base.channel==\"20.04\") | .releases[] | select(.channel==\"$channel/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==\"$channel/beta\")| .version'|head -1"
                                     } else {
-                                        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"
+                                        jqScriptEdge = "cat ${charm}.json | jq -r '.[] | select(.track==\"$channel\") | .mappings[].releases[] | select(.channel==\"$channel/edge/merged\")| .version'|head -1"
+                                        jqScriptBeta = "cat ${charm}.json | jq -r '.[] | select(.track==\"$channel\") | .mappings[].releases[] | select(.channel==\"$channel/beta\")| .version'|head -1"
                                     }
                                     // edge/merged is used in place of /edge as 10.1.0 LTS uses latest/edge
                                     edge_rev = sh(returnStdout: true, script: jqScriptEdge).trim()