aboutsummaryrefslogtreecommitdiffstats
path: root/test/ete/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'test/ete/scripts')
-rwxr-xr-xtest/ete/scripts/deploy-onap.sh22
1 files changed, 17 insertions, 5 deletions
diff --git a/test/ete/scripts/deploy-onap.sh b/test/ete/scripts/deploy-onap.sh
index 9c9bfc110..c87f9a94e 100755
--- a/test/ete/scripts/deploy-onap.sh
+++ b/test/ete/scripts/deploy-onap.sh
@@ -1,9 +1,21 @@
#!/bin/bash -x
+if [ "$#" -ne 1 ]; then
+ echo "Usage: $0 <lab-name>"
+ exit 1
+fi
+
if [ -z "$WORKSPACE" ]; then
export WORKSPACE=`git rev-parse --show-toplevel`
fi
+LAB_DIR=${WORKSPACE}/test/ete/labs/$1
+
+if [ ! -d "$LAB_DIR" ]; then
+ echo "Directory $LAB_DIR not found"
+ exit 2
+fi
+
source $WORKSPACE/test/ete/scripts/install_openstack_cli.sh
$WORKSPACE/test/ete/scripts/teardown-onap.sh
@@ -14,9 +26,9 @@ echo "New Stack Name: ${STACK}"
SENTINEL='Docker versions and branches'
YAML_FILE=${ONAP_WORKDIR}/demo/heat/ONAP/onap_openstack.yaml
-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 | sed -n "1,/${SENTINEL}/p" > ${ENV_FILE}
+ENV_FILE=${LAB_DIR}/onap-openstack.env
+cp ${ONAP_WORKDIR}/demo/heat/ONAP/onap_openstack.env ${LAB_DIR}/onap-openstack-demo.env
+envsubst < ${LAB_DIR}/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}
@@ -24,9 +36,9 @@ 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
+#diff ${LAB_DIR}/onap-openstack-template.env ${LAB_DIR}/onap-openstack.env
-openstack stack create -t ${YAML_FILE} -e ${WORKSPACE}/test/ete/labs/windriver/onap-openstack.env $STACK
+openstack stack create -t ${YAML_FILE} -e ${LAB_DIR}/onap-openstack.env $STACK
while [ "CREATE_IN_PROGRESS" == "$(openstack stack show -c stack_status -f value $STACK)" ]; do
sleep 20