8790c4db63b5e12920316dafdb6cd680bb7a151e
[osm/devops.git] / installers / charm / release_edge.sh
1 #!/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.
15 set -eux
16
17 channel=edge
18 tag=testing-daily
19
20 # 1. Build charms
21 ./build.sh
22
23 # 2. Release charms
24 # Reactive charms
25 charms="lcm-k8s mon-k8s pol-k8s ro-k8s"
26 for charm in $charms; do
27 cs_revision=`charm push $charm/release cs:~charmed-osm/$charm | tail -n +1 | head -1 | awk '{print $2}'`
28 charm release --channel $channel $cs_revision
29 echo "$charm charm released!"
30 done
31
32 # New charms (with no resources)
33 charms="pla keystone"
34 for charm in $charms; do
35 echo "Releasing $charm charm"
36 cs_revision=`charm push $charm/$charm.charm cs:~charmed-osm/$charm | tail -n +1 | head -1 | awk '{print $2}'`
37 charm release --channel $channel $cs_revision
38 echo "$charm charm released!"
39 done
40
41 # New charms (with resources)
42 charms="ng-ui nbi"
43 for charm in $charms; do
44 echo "Releasing $charm charm"
45 cs_revision=$(charm push $charm/$charm.charm cs:~charmed-osm/$charm | tail -n +1 | head -1 | awk '{print $2}')
46 resource_revision=$(charm attach $cs_revision image=external::opensourcemano/$charm:$tag | tail -n +1 | sed 's/[^0-9]*//g')
47 image_revision_num=$(echo $resource_revision | awk '{print $NF}')
48 resources_string="--resource image-$image_revision_num"
49 charm release --channel $channel $cs_revision $resources_string
50 echo "$charm charm released!"
51 done