2 #placeholder for deployment script.
5 # ./02-deploybundle.sh $opnfvtype $openstack $opnfvlab $opnfvsdn $opnfvfeature $opnfvdistro
14 #copy and download charms
15 cp $opnfvsdn/fetch-charms.sh ./fetch-charms.sh
17 #modify the ubuntu series wants to deploy
18 sed -i -- "s|distro=trusty|distro=$opnfvdistro|g" ./fetch-charms.sh
20 ./fetch-charms.sh $opnfvdistro
24 #check whether charms are still executing the code even juju-deployer says installed.
28 while [ $retval -eq 0 ]; do
30 juju status > status.txt
31 if [ "$(grep -c "executing" status.txt )" -ge 2 ]; then
32 echo " still executing the reltionship within charms ..."
33 if [ $timeoutiter -ge 60 ]; then
36 timeoutiter=$((timeoutiter+1))
41 echo "...... deployment finishing ......."
44 #read the value from deployment.yaml
45 if [ -e ~/.juju/deployment.yaml ]; then
46 cp ~/.juju/deployment.yaml ./deployment.yaml
47 if [ -e ~/.juju/deployconfig.yaml ]; then
48 cp ~/.juju/deployconfig.yaml ./deployconfig.yaml
49 extport=`grep "ext-port" deployconfig.yaml | cut -d ' ' -f 4 | sed -e 's/ //' | tr ',' ' '`
50 datanet=`grep "dataNetwork" deployconfig.yaml | cut -d ' ' -f 4 | sed -e 's/ //'`
51 admnet=`grep "admNetwork" deployconfig.yaml | cut -d ' ' -f 4 | sed -e 's/ //'`
52 cephdisk=`grep "ceph-disk" deployconfig.yaml | cut -d ':' -f 2 | sed -e 's/ //'`
53 osdomname=`grep "os-domain-name" deployconfig.yaml | cut -d ':' -f 2 | sed -e 's/ //'`
59 sed -i -- 's/10.4.1.1/172.16.50.1/g' ./bundles.yaml
60 sed -i -- 's/#ext-port: "eth1"/ext-port: "eth1"/g' ./bundles.yaml
63 sed -i -- 's/#ext-port: "eth1"/ext-port: "eth2"/g' ./bundles.yaml
67 # lets put the if seperateor as "," as this will save me from world.
70 for feature in $opnfvfeature; do
71 if [ "$fea" == "" ]; then
78 #update source if trusty is target distribution
79 var=os-$opnfvsdn-$fea-$opnfvtype"-"$opnfvdistro"_"$openstack
81 if [ "$osdomname" != "None" ]; then
85 #lets generate the bundle for all target using genBundle.py
86 python genBundle.py -l deployconfig.yaml -s $var > bundles.yaml
88 echo "... Deployment Started ...."
89 juju-deployer -vW -d -t 7200 -r 5 -c bundles.yaml $opnfvdistro-"$openstack"-nodes
91 # seeing issue related to number of open files.
92 # juju run --service nodes 'echo 2048 | sudo tee /proc/sys/fs/inotify/max_user_instances'
94 count=`juju status nodes --format=short | grep nodes | wc -l`
97 while [ $c -lt $count ]; do
98 juju ssh nodes/$c 'echo 2048 | sudo tee /proc/sys/fs/inotify/max_user_instances'
102 juju-deployer -vW -d -t 7200 -r 5 -c bundles.yaml $opnfvdistro-"$openstack" || true