aboutsummaryrefslogtreecommitdiffstats
path: root/test/ete/scripts
diff options
context:
space:
mode:
authorGary Wu <gary.i.wu@huawei.com>2018-01-05 13:16:26 -0800
committerGary Wu <gary.i.wu@huawei.com>2018-01-05 21:29:40 +0000
commitf82334365c86fcee00310456f17b40d6af782f23 (patch)
tree43e416328648b2ecff65b1b713d4c98b59b1db98 /test/ete/scripts
parent0ee8b9c1992a8b48bb68522cd6130391f1c51642 (diff)
Refactor CI script to support other envionments
Change-Id: I4befdd9dc89a04620b53de8675f241f43d4e144e Issue-ID: INT-278 Signed-off-by: Gary Wu <gary.i.wu@huawei.com> (cherry picked from commit 3c0b105517b51584edd114765560f11ebabb4a4e)
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