modfied to cleanup copying of yaml files from .juju/ 47/19247/2
authornarindergupta <narinder.gupta@canonical.com>
Mon, 22 Aug 2016 19:01:20 +0000 (15:01 -0400)
committernarindergupta <narinder.gupta@canonical.com>
Mon, 22 Aug 2016 19:04:51 +0000 (15:04 -0400)
Change-Id: I1c44815b9b4217033034faf4a2880f5737f81fad
Signed-off-by: Narinder Gupta <narinder.gupta@canonical.com>
ci/02-deploybundle.sh
ci/deploy.sh
ci/openstack.sh

index 8a0502d..9242ebb 100755 (executable)
@@ -42,11 +42,9 @@ check_status() {
 }
 
 #read the value from deployment.yaml
-if [ -e ~/.juju/deployment.yaml ]; then
-   cp ~/.juju/deployment.yaml ./deployment.yaml
-   if [ -e ~/.juju/deployconfig.yaml ]; then
-      cp ~/.juju/deployconfig.yaml ./deployconfig.yaml
-      cp ~/.juju/labconfig.yaml ./labconfig.yaml
+
+if [ -e ./deployment.yaml ]; then
+   if [ -e ./deployconfig.yaml ]; then
       extport=`grep "ext-port" deployconfig.yaml | cut -d ' ' -f 4 | sed -e 's/ //' | tr ',' ' '`
       datanet=`grep "dataNetwork" deployconfig.yaml | cut -d ' ' -f 4 | sed -e 's/ //'`
       admnet=`grep "admNetwork" deployconfig.yaml | cut -d ' ' -f 4 | sed -e 's/ //'`
index 1dab85d..8692df6 100755 (executable)
@@ -110,6 +110,12 @@ deploy() {
     if [ ! -f ./environments.yaml ] && [ -e ~/.juju/environments.yaml ]; then
         cp ~/.juju/environments.yaml ./environments.yaml
     fi
+    if [ ! -f ./labconfig.yaml ] && [ -e ~/.juju/labconfig.yaml ]; then
+        cp ~/.juju/labconfig.yaml ./labconfig.yaml
+    fi
+    if [ ! -f ./deployconfig.yaml ] && [ -e ~/.juju/deployconfig.yaml ]; then
+        cp ~/.juju/deployconfig.yaml ./deployconfig.yaml
+    fi
 
     #copy the script which needs to get deployed as part of ofnfv release
     echo "...... deploying now ......"
index 08f1548..a76785b 100755 (executable)
@@ -128,12 +128,14 @@ create_openrc
 echo "...... deploy public api proxy ......"
 
 if [ "$opnfvlab" == "orangepod1" ] && [ "$opnfvsdn" == "nosdn" ]; then # only for first test phase
-    PUB_API_NET=$(grep floating-ip-range ./labconfig.yaml |cut -d/ -f2)
-    PUB_API_IP=$(grep public-api-ip ./labconfig.yaml |cut -d: -f2)
-    juju run --unit nodes/0 "sudo ip a a ${PUB_API_IP}/${PUB_API_NET} dev br-ex" || true
-    juju run --unit nodes/0 "sudo ip l set dev br-ex up" || true
-    python genPublicAPIProxyBundle.py -l labconfig.yaml >> bundles.yaml
-    juju-deployer -vW -d -t 7200 -r 5 -c bundles.yaml $opnfvdistro-"$openstack" || true
+    if [ -e ./labconfig.yaml ]; then
+        PUB_API_NET=$(grep floating-ip-range ./labconfig.yaml |cut -d/ -f2)
+        PUB_API_IP=$(grep public-api-ip ./labconfig.yaml |cut -d: -f2)
+        juju run --unit nodes/0 "sudo ip a a ${PUB_API_IP}/${PUB_API_NET} dev br-ex" || true
+        juju run --unit nodes/0 "sudo ip l set dev br-ex up" || true
+        python genPublicAPIProxyBundle.py -l labconfig.yaml >> bundles.yaml
+        juju-deployer -vW -d -t 7200 -r 5 -c bundles.yaml $opnfvdistro-"$openstack" || true
+    fi
 fi
 
 echo "...... deploy end public api proxy ......"