From: Mark Beierl Date: Fri, 11 Aug 2023 15:26:22 +0000 (+0000) Subject: Use 22.04 as base for charms X-Git-Tag: release-v15.0-start~29 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=c7da11d48593106cb9db1f7a3f9208593fdc5ed4;p=osm%2Fdevops.git Use 22.04 as base for charms When promoting charms that are now 22.04 based, we need to use the correct base channel Change-Id: I0c384dc9c253df28f9ad55e289b0d53c0d21f844 Signed-off-by: Mark Beierl --- diff --git a/jenkins/ci-pipelines/ci_stage_3.groovy b/jenkins/ci-pipelines/ci_stage_3.groovy index c94b80a9..3bd921d3 100644 --- a/jenkins/ci-pipelines/ci_stage_3.groovy +++ b/jenkins/ci-pipelines/ci_stage_3.groovy @@ -531,7 +531,7 @@ node("${params.NODE}") { ] sshCommand remote: remote, command: ''' - wget https://osm-download.etsi.org/ftp/osm-13.0-thirteen/install_osm.sh + wget https://osm-download.etsi.org/ftp/osm-14.0-fourteen/install_osm.sh chmod +x ./install_osm.sh sed -i '1 i\\export PATH=/snap/bin:\$PATH' ~/.bashrc ''' @@ -712,24 +712,25 @@ EOF""" } // stage('Snap promotion') stage('Charm promotion') { charms = [ - 'osm', // bundle - 'osm-ha', // bundle - 'osm-grafana', - 'osm-mariadb', - 'mongodb-exporter-k8s', - 'mysqld-exporter-k8s', - 'osm-lcm', - 'osm-mon', - 'osm-nbi', - 'osm-ng-ui', - 'osm-pol', - 'osm-ro', - 'osm-prometheus', - 'osm-update-db-operator', - 'osm-vca-integrator', + [name: 'osm', base: "22.04"], + [name: 'osm-ha', base: "22.04"], + [name: 'mongodb-exporter-k8s', base: "20.04"], + [name: 'mysqld-exporter-k8s', base: "20.04"], + [name: 'osm-grafana', base: "20.04"], + [name: 'osm-keystone', base: "22.04"], + [name: 'osm-lcm', base: "22.04"], + [name: 'osm-mon', base: "22.04"], + [name: 'osm-nbi', base: "22.04"], + [name: 'osm-ng-ui', base: "22.04"], + [name: 'osm-pol', base: "22.04"], + [name: 'osm-ro', base: "22.04"], + [name: 'osm-prometheus', base: "20.04"], + [name: 'osm-update-db-operator', base: "20.04"], + [name: 'osm-vca-integrator', base: "22.04"], ] - for (charm in charms) { - + for (entry in charms) { + charm = entry.name + base = entry.base channel = 'latest' if (BRANCH_NAME.startsWith('v')) { channel = BRANCH_NAME.substring(1) @@ -739,15 +740,15 @@ EOF""" withCredentials([string(credentialsId: 'Charmstore', variable: 'CHARMCRAFT_AUTH')]) { sh "charmcraft status $charm --format json > ${charm}.json" - isCharm = sh(returnStdout: true, script: "grep architecture ${charm}.json | wc -l").trim() as int + isCharm = sh(returnStdout: true, script: "grep architecture ${charm}.json | wc -l 2>/dev/null").trim() as int resourceArgument = "" if (isCharm) { - 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" + jqScriptEdge = "cat ${charm}.json | jq -r '.[] | select(.track==\"$channel\") | .mappings[] | select(.base.architecture==\"amd64\" and .base.channel==\"$base\") | .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==\"$base\") | .releases[] | select(.channel==\"$channel/beta\")| .version'|head -1" index=0 while (index < 5) { - resourceNameScript = "cat ${charm}.json | jq -r '.[] | select(.track==\"$channel\") | .mappings[] | select(.base.architecture==\"amd64\" and .base.channel==\"20.04\") | .releases[] | select(.channel==\"$channel/edge/merged\")| .resources[$index].name'|head -1" - resourceRevsScript = "cat ${charm}.json | jq -r '.[] | select(.track==\"$channel\") | .mappings[] | select(.base.architecture==\"amd64\" and .base.channel==\"20.04\") | .releases[] | select(.channel==\"$channel/edge/merged\")| .resources[$index].revision'|head -1" + resourceNameScript = "cat ${charm}.json | jq -r '.[] | select(.track==\"$channel\") | .mappings[] | select(.base.architecture==\"amd64\" and .base.channel==\"$base\") | .releases[] | select(.channel==\"$channel/edge/merged\")| .resources[$index].name'|head -1" + resourceRevsScript = "cat ${charm}.json | jq -r '.[] | select(.track==\"$channel\") | .mappings[] | select(.base.architecture==\"amd64\" and .base.channel==\"$base\") | .releases[] | select(.channel==\"$channel/edge/merged\")| .resources[$index].revision'|head -1" resourceName = sh(returnStdout: true, script: resourceNameScript).trim() resourceRevs = sh(returnStdout: true, script: resourceRevsScript).trim() if (resourceName != "null") {