Auto-generate docker versions and repo branches

Auto-generate the docker versions and repo branches using
the latest heat environment file from demo repo.

Change-Id: Ia00ec9f1c0bc59d0cdf9639e0d5ac5b13f9716c8
Issue-ID: INT-278
Signed-off-by: Gary Wu <gary.i.wu@huawei.com>
diff --git a/test/ete/scripts/deploy-onap.sh b/test/ete/scripts/deploy-onap.sh
index 4802e02..9919fe7 100755
--- a/test/ete/scripts/deploy-onap.sh
+++ b/test/ete/scripts/deploy-onap.sh
@@ -28,14 +28,23 @@
 echo "New Stack Name: ${STACK}"
 
 
+SENTINEL='Docker versions and branches'
+ENV_FILE=${WORKSPACE}/test/ete/labs/windriver/onap-openstack.env
 cp ${ONAP_WORKDIR}/demo/heat/ONAP/onap_openstack.env ${WORKSPACE}/test/ete/labs/windriver/onap-openstack-demo.env
-envsubst < ${WORKSPACE}/test/ete/labs/windriver/onap-openstack-template.env > ${WORKSPACE}/test/ete/labs/windriver/onap-openstack.env
+envsubst < ${WORKSPACE}/test/ete/labs/windriver/onap-openstack-template.env | sed -n "1,/${SENTINEL}/p" > ${ENV_FILE}
+pushd ${ONAP_WORKDIR}/demo
+echo "  # Rest of the file was AUTO-GENERATED from"
+echo "  #" $(git config --get remote.origin.url) heat/ONAP/onap_openstack.env $(git rev-parse HEAD) | tee -a ${ENV_FILE}
+popd
+sed "1,/${SENTINEL}/d" ${ONAP_WORKDIR}/demo/heat/ONAP/onap_openstack.env >> ${ENV_FILE}
+cat ${ENV_FILE}
+
 #diff ${WORKSPACE}/test/ete/labs/windriver/onap-openstack-template.env ${WORKSPACE}/test/ete/labs/windriver/onap-openstack.env
 
 openstack stack create -t ${ONAP_WORKDIR}/demo/heat/ONAP/onap_openstack.yaml -e ${WORKSPACE}/test/ete/labs/windriver/onap-openstack.env $STACK
 
 while [ "CREATE_IN_PROGRESS" == "$(openstack stack show -c stack_status -f value $STACK)" ]; do
-    sleep 15
+    sleep 20
 done
 
 STATUS=$(openstack stack show -c stack_status -f value $STACK)
@@ -59,5 +68,5 @@
 
 until ssh -o StrictHostKeychecking=no -i ${SSH_KEY} root@${ROBOT_IP} "docker ps | grep -q openecompete_container"
 do
-      sleep 1m
+      sleep 2m
 done