-
- stage("Snap promotion") {
- def snaps = ["osmclient"]
- sh "snapcraft login --with ~/.snapcraft/config"
- for (snap in snaps) {
- channel="latest/"
- if (BRANCH_NAME.startsWith("v")) {
- channel=BRANCH_NAME.substring(1)+"/"
- } else if (BRANCH_NAME!="master") {
- channel+="/"+BRANCH_NAME.replaceAll('/','-')
+ stage('Snap promotion') {
+ withCredentials([string(credentialsId: 'Snapstore', variable: 'SNAPCRAFT_STORE_CREDENTIALS')]) {
+ snaps = ['osmclient']
+ for (snap in snaps) {
+ channel = 'latest/'
+ if (BRANCH_NAME.startsWith('v')) {
+ channel = BRANCH_NAME.substring(1) + '/'
+ } else if (BRANCH_NAME != 'master') {
+ channel += '/' + BRANCH_NAME.replaceAll('/', '-')
+ }
+ track = channel + 'edge\\*'
+ edge_rev = sh(returnStdout: true,
+ script: "snapcraft revisions $snap | " +
+ "grep \"$track\" | tail -1 | awk '{print \$1}'").trim()
+ track = channel + 'beta\\*'
+ beta_rev = sh(returnStdout: true,
+ script: "snapcraft revisions $snap | " +
+ "grep \"$track\" | tail -1 | awk '{print \$1}'").trim()
+
+ print "Edge: $edge_rev, Beta: $beta_rev"
+
+ if (edge_rev != beta_rev) {
+ print "Promoting $edge_rev to beta in place of $beta_rev"
+ beta_track = channel + 'beta'
+ sh "snapcraft release $snap $edge_rev $beta_track"
+ }
+ }
+ }
+ } // stage('Snap promotion')
+ stage('Charm promotion') {
+ charms = [
+ 'osm', // bundle
+ 'osm-ha', // bundle
+ 'osm-grafana',
+ //'juju-simplestreams-operator',
+ //'kafka-exporter',
+ 'osm-mariadb',
+ //'mongodb-exporter',
+ //'mysqld-exporter',
+ 'osm-lcm',
+ 'osm-mon',
+ 'osm-nbi',
+ 'osm-ng-ui',
+ 'osm-pol',
+ 'osm-ro',
+ 'osm-prometheus',
+ //'osm-vca-integrator-operator',
+ ]
+ for (charm in charms) {
+
+ channel = 'latest'
+ if (BRANCH_NAME.startsWith('v')) {
+ channel = BRANCH_NAME.substring(1)
+ } else if (BRANCH_NAME != 'master') {
+ channel += '/' + BRANCH_NAME.replaceAll('/', '-')