Fix wget and sleep 180 87/20587/1
authorLusheng Ji <lji@research.att.com>
Wed, 25 Oct 2017 17:36:54 +0000 (13:36 -0400)
committerLusheng Ji <lji@research.att.com>
Wed, 25 Oct 2017 17:37:01 +0000 (13:37 -0400)
1. Fix the wget of cent_os and cosul_cluster BPs not over-writing old copies.
2. Replace sleep 180 after launching CM VM to a ping wait

Issue-Id: DCAEGEN2-128
Change-Id: I9ff8f770a320291c1c26d3c1159a52764d677f98
Signed-off-by: Lusheng Ji <lji@research.att.com>
bootstrap/installer-docker.sh-template

index 867dc1a..ddf330d 100755 (executable)
@@ -110,10 +110,12 @@ sed -e "s#key_filename:.*#key_filename: $PVTKEY#" < ${INPUTS} > /tmp/local_input
 # Now install the VM
 # Don't exit on error after this point--keep container running so we can do uninstalls after a failure
 set +e
-if wget -P ./blueprints/ {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_blueprints_releases }}/blueprints/centos_vm.yaml; then
+if wget -O /tmp/centos_vm.yaml {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_blueprints_releases }}/blueprints/centos_vm.yaml; then
+  mv -f /tmp/centos_vm.yaml ./blueprints/
   echo "Succeeded in getting the newest centos_vm.yaml"
 else
   echo "Failed to update centos_vm.yaml, using default version"
+  rm -f /tmp/centos_vm.yaml
 fi
 set -e
 cfy local init --install-plugins -p ./blueprints/centos_vm.yaml -i /tmp/local_inputs -i "datacenter=$LOCATION"
@@ -122,7 +124,13 @@ PUBIP=$(cfy local outputs | grep -Po '"public_ip": "\K.*?(?=")')
 
 
 ## It's probably not completely ready when the installation finish, so wait
-sleep 180
+#sleep 180
+while [ $( ping -c 1 $PUBIP 2> /dev/null | grep icmp* | wc -l ) -eq 0 ];
+do
+  sleep 5
+  echo "."
+done
+sleep 10
 
 echo "Installing Cloudify Manager on ${PUBIP}."
 
@@ -282,10 +290,12 @@ cfy use -t ${PUBIP}
 echo "Deploying Consul VM"
 
 set +e
-if wget -P ../blueprints/ {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_blueprints_releases }}/consul_cluster.yaml; then
+if wget -O /tmp/consul_cluster.yaml {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_blueprints_releases }}/blueprints/consul_cluster.yaml; then
+  mv -f /tmp/consul_cluster.yaml ../blueprints/
   echo "Succeeded in getting the newest consul_cluster.yaml"
 else
   echo "Failed to update consul_cluster.yaml, using default version"
+  rm -f /tmp/consul_cluster.yaml
 fi
 set -e
 cfy install -p ../blueprints/consul_cluster.yaml -d consul -i ../${INPUTS} -i "datacenter=$LOCATION"