aboutsummaryrefslogtreecommitdiffstats
path: root/test/ete
diff options
context:
space:
mode:
authorGary Wu <gary.i.wu@huawei.com>2017-10-23 14:22:40 -0700
committerGary Wu <gary.i.wu@huawei.com>2017-10-23 14:22:40 -0700
commit838c34d02bcc34576dc660058a2beb08add8f334 (patch)
tree2b66cd024f149bc93cebe86bfc138b46fe25b9ab /test/ete
parent5f717419d9cbc937df2a0ab61a8d6f513375c8be (diff)
Refactor deployment scripts
Change-Id: Ib82ddeb13902afdc50de61e1042cf8b810581509 Issue-ID: INT-278 Signed-off-by: Gary Wu <gary.i.wu@huawei.com>
Diffstat (limited to 'test/ete')
-rwxr-xr-xtest/ete/scripts/deploy-onap.sh42
-rwxr-xr-x[-rw-r--r--]test/ete/scripts/get-floating-ip.sh0
-rwxr-xr-xtest/ete/scripts/install_openstack_cli.sh47
3 files changed, 48 insertions, 41 deletions
diff --git a/test/ete/scripts/deploy-onap.sh b/test/ete/scripts/deploy-onap.sh
index 2106175a9..02943935d 100755
--- a/test/ete/scripts/deploy-onap.sh
+++ b/test/ete/scripts/deploy-onap.sh
@@ -1,50 +1,10 @@
#!/bin/bash
-if [ -z "$OS_AUTH_URL" ] || [ -z "$OS_USERNAME" ]
-then
- echo "ERROR: OpenStack environment variables not set. Please source your OpenStack RC script first."
- exit 1
-fi
-
-
if [ -z "$WORKSPACE" ]; then
export WORKSPACE=`git rev-parse --show-toplevel`
fi
-
-
-# Assume that if ROBOT_VENV is set, we don't need to reinstall robot
-if [ -f ${WORKSPACE}/env.properties ]; then
- source ${WORKSPACE}/env.properties
-fi
-
-if [ ! -z "$ONAP_VENV" ] && [ -f "$ONAP_VENV/bin/activate" ]; then
- source ${ONAP_VENV}/bin/activate
-else
- ONAP_VENV=$(mktemp -d --suffix=_onap_venv)
- virtualenv ${ONAP_VENV}
- source ${ONAP_VENV}/bin/activate
-
- pip install --upgrade pip
- pip install --upgrade python-openstackclient python-heatclient
-
- echo "ONAP_VENV=${ONAP_VENV}" >> $WORKSPACE/env.properties
-fi
-echo "ONAP_VENV=${ONAP_VENV}"
-
-if [ -z "$ONAP_WORKDIR" ]; then
- ONAP_WORKDIR=$(mktemp -d --suffix=_onap_workdir)
- echo "ONAP_WORKDIR=${ONAP_WORKDIR}" >> $WORKSPACE/env.properties
-fi
-echo "ONAP_WORKDIR=${ONAP_WORKDIR}"
-if [ ! -d ${ONAP_WORKDIR}/demo ]; then
- git clone http://gerrit.onap.org/r/demo ${ONAP_WORKDIR}/demo
-else
- pushd ${ONAP_WORKDIR}/demo
- git pull
- popd
-fi
-
+source $WORKSPACE/test/ete/scripts/install_openstack_cli.sh
# Delete all existing stacks
STACKS=$(openstack stack list -c "Stack Name" -f value)
diff --git a/test/ete/scripts/get-floating-ip.sh b/test/ete/scripts/get-floating-ip.sh
index 55854e73f..55854e73f 100644..100755
--- a/test/ete/scripts/get-floating-ip.sh
+++ b/test/ete/scripts/get-floating-ip.sh
diff --git a/test/ete/scripts/install_openstack_cli.sh b/test/ete/scripts/install_openstack_cli.sh
new file mode 100755
index 000000000..ec5ad1f76
--- /dev/null
+++ b/test/ete/scripts/install_openstack_cli.sh
@@ -0,0 +1,47 @@
+#!/bin/bash
+
+if [ -z "$OS_AUTH_URL" ] || [ -z "$OS_USERNAME" ]
+then
+ echo "ERROR: OpenStack environment variables not set. Please source your OpenStack RC script first."
+ exit 1
+fi
+
+
+if [ -z "$WORKSPACE" ]; then
+ export WORKSPACE=`git rev-parse --show-toplevel`
+fi
+
+
+
+# Assume that if ROBOT_VENV is set, we don't need to reinstall robot
+if [ -f ${WORKSPACE}/env.properties ]; then
+ source ${WORKSPACE}/env.properties
+fi
+
+if [ ! -z "$ONAP_VENV" ] && [ -f "$ONAP_VENV/bin/activate" ]; then
+ source ${ONAP_VENV}/bin/activate
+else
+ ONAP_VENV=$(mktemp -d --suffix=_onap_venv)
+ virtualenv ${ONAP_VENV}
+ source ${ONAP_VENV}/bin/activate
+
+ pip install --upgrade pip
+ pip install --upgrade python-openstackclient python-heatclient
+
+ echo "ONAP_VENV=${ONAP_VENV}" >> $WORKSPACE/env.properties
+fi
+echo "ONAP_VENV=${ONAP_VENV}"
+
+if [ -z "$ONAP_WORKDIR" ]; then
+ ONAP_WORKDIR=$(mktemp -d --suffix=_onap_workdir)
+ echo "ONAP_WORKDIR=${ONAP_WORKDIR}" >> $WORKSPACE/env.properties
+fi
+echo "ONAP_WORKDIR=${ONAP_WORKDIR}"
+if [ ! -d ${ONAP_WORKDIR}/demo ]; then
+ git clone http://gerrit.onap.org/r/demo ${ONAP_WORKDIR}/demo
+else
+ pushd ${ONAP_WORKDIR}/demo
+ git pull
+ popd
+fi
+