blob: a3d698e84142d71d051e4d28d72c7673b4c1bbe5 [file] [log] [blame]
David Garciaef349d92020-12-10 21:16:12 +01001#!/bin/bash
2# Copyright 2020 Canonical Ltd.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15set -eux
16
17channel=edge
18tag=testing-daily
19
20# 1. Build charms
21./build.sh
22
23# 2. Release charms
24# Reactive charms
25charms="lcm-k8s mon-k8s pol-k8s ro-k8s"
26charms=""
27for charm in $charms; do
28 cs_revision=`charm push $charm/release cs:~charmed-osm/$charm | tail -n +1 | head -1 | awk '{print $2}'`
29 charm release --channel $channel $cs_revision
30 echo "$charm charm released!"
31done
32
33# New charms (with no resources)
34charms="pla keystone"
35charms=""
36for charm in $charms; do
37 echo "Releasing $charm charm"
38 cs_revision=`charm push $charm/$charm.charm cs:~charmed-osm/$charm | tail -n +1 | head -1 | awk '{print $2}'`
39 charm release --channel $channel $cs_revision
40 echo "$charm charm released!"
41done
42
43# New charms (with resources)
44charms="ng-ui nbi"
45charms="nbi"
46for charm in $charms; do
47 echo "Releasing $charm charm"
48 cs_revision=$(charm push $charm/$charm.charm cs:~charmed-osm/$charm | tail -n +1 | head -1 | awk '{print $2}')
49 resource_revision=$(charm attach $cs_revision image=external::opensourcemano/$charm:$tag | tail -n +1 | sed 's/[^0-9]*//g')
50 image_revision_num=$(echo $resource_revision | awk '{print $NF}')
51 resources_string="--resource image-$image_revision_num"
52 charm release --channel $channel $cs_revision $resources_string
53 echo "$charm charm released!"
54done