cd $1 && tox -e build && cd ..
}
-# reactive_charms=""
-# for charm_directory in $reactive_charms; do
-# echo "Building charm $charm_directory..."
-# cd $charm_directory
-# charmcraft build
-# cd ..
-# done
-
-# build 'lcm-k8s'
-# build 'mon-k8s'
-# build 'nbi-k8s'
-# build 'pol-k8s'
-# build 'ro-k8s'
-# build 'ui-k8s'
-
-charms="ro nbi pla pol mon lcm ng-ui keystone grafana prometheus keystone mariadb-k8s mongodb-k8s zookeeper-k8s kafka-k8s"
+charms="ro nbi pla pol mon lcm ng-ui keystone grafana prometheus keystone mariadb-k8s mongodb-k8s zookeeper-k8s kafka-k8s mongodb-exporter kafka-exporter mysqld-exporter"
if [ -z `which charmcraft` ]; then
sudo snap install charmcraft --edge
fi
# 1. Build charms
./build.sh
-# 2. Release charms
-# Reactive charms
-charms="lcm-k8s mon-k8s pol-k8s ro-k8s"
-for charm in $charms; do
- cs_revision=`charm push $charm/release cs:~charmed-osm/$charm | tail -n +1 | head -1 | awk '{print $2}'`
- charm release --channel $channel $cs_revision
- echo "$charm charm released!"
-done
# New charms (with resources)
charms="ng-ui nbi pla keystone ro lcm mon pol"
echo "$charm charm released!"
done
+charms="mongodb-exporter kafka-exporter mysqld-exporter"
+for charm in $charms; do
+ echo "Releasing $charm charm"
+ cs_revision=$(charm push $charm/$charm.charm cs:~charmed-osm/$charm | tail -n +1 | head -1 | awk '{print $2}')
+ resource_revision=$(charm attach $cs_revision image=external::bitnami/$charm:latest | tail -n +1 | sed 's/[^0-9]*//g')
+ image_revision_num=$(echo $resource_revision | awk '{print $NF}')
+ resources_string="--resource image-$image_revision_num"
+ charm release --channel $channel $cs_revision $resources_string
+ echo "$charm charm released!"
+done
+
charm="prometheus"
echo "Releasing $charm charm"
cs_revision=$(charm push $charm/$charm.charm cs:~charmed-osm/$charm | tail -n +1 | head -1 | awk '{print $2}')
echo "$charm charm released!"
# 3. Grant permissions
-all_charms="ng-ui nbi pla keystone ro lcm mon pol grafana prometheus"
+all_charms="ng-ui nbi pla keystone ro lcm mon pol grafana prometheus mongodb-exporter kafka-exporter mysqld-exporter"
for charm in $all_charms; do
echo "Granting permission for $charm charm"
charm grant cs:~charmed-osm/$charm --channel $channel --acl read everyone