K8S_CLOUD_NAME="k8s-cloud"
KUBECTL="microk8s.kubectl"
MICROK8S_VERSION=1.26
-OSMCLIENT_VERSION=latest
+OSMCLIENT_VERSION=14.0
IMAGES_OVERLAY_FILE=~/.osm/images-overlay.yaml
PASSWORD_OVERLAY_FILE=~/.osm/password-overlay.yaml
PATH=/snap/bin:${PATH}
OSM_BUNDLE=ch:osm
OSM_HA_BUNDLE=ch:osm-ha
-CHARMHUB_CHANNEL=latest/beta
+CHARMHUB_CHANNEL=14.0
unset TAG
function check_arguments(){
echo "Deploying OSM with charms"
images_overlay=""
if [ -v REGISTRY_URL ]; then
- [ ! -v TAG ] && TAG='latest'
+ [ ! -v TAG ] && TAG='14.0'
fi
[ -v TAG ] && generate_images_overlay && images_overlay="--overlay $IMAGES_OVERLAY_FILE"
applications:
pla:
charm: osm-pla
- channel: latest/stable
+ channel: 14.0
scale: $scale
series: kubernetes
options:
} // 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-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)
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") {