summaryrefslogtreecommitdiffstats
path: root/testcases/vIMS/CI/create_venv.sh
diff options
context:
space:
mode:
authorboucherv <valentin.boucher@orange.com>2015-10-02 09:29:33 +0200
committerboucherv <valentin.boucher@orange.com>2015-10-05 09:57:18 +0200
commit7040a716bdc4ca36e22988fdc931adb080e2a059 (patch)
treeb21185a931a21abc92ac4685ffa2cfaa24f2ec02 /testcases/vIMS/CI/create_venv.sh
parentef6d69f42a875f1354a953a80670a5bffcbdc05b (diff)
vIMS deployment and cleanup
These scripts allow to : - Prepare platform (tenant, user, image, quota etc) - Deploy cloudify-manager-server - Deploy vIMS Clearwater - Undeploy vIMS - Undeploy cloudify-manager-server - Clean the platform vIMS test coming soon JIRA: FUNCTEST-38 Change-Id: I35be6433c6511d741a27b67fe24c3031f1e29fe5 Signed-off-by: boucherv <valentin.boucher@orange.com>
Diffstat (limited to 'testcases/vIMS/CI/create_venv.sh')
-rwxr-xr-xtestcases/vIMS/CI/create_venv.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/testcases/vIMS/CI/create_venv.sh b/testcases/vIMS/CI/create_venv.sh
new file mode 100755
index 000000000..15294f77b
--- /dev/null
+++ b/testcases/vIMS/CI/create_venv.sh
@@ -0,0 +1,36 @@
+#!/bin/bash -e
+
+# Script checks that venv exists. If it doesn't it will be created
+# It requires python2.7 and virtualenv packages installed
+
+BASEDIR=`dirname $0`
+VENV_PATH=$1
+VENV_NAME="venv_cloudify"
+function venv_install() {
+ if command -v virtualenv-2.7; then
+ virtualenv-2.7 $1
+ elif command -v virtualenv2; then
+ virtualenv2 $1
+ elif command -v virtualenv; then
+ virtualenv $1
+ else
+ echo Cannot find virtualenv command.
+ return 1
+ fi
+}
+
+# exit when something goes wrong during venv install
+set -e
+if [ ! -d "$VENV_PATH/$VENV_NAME" ]; then
+ venv_install $VENV_PATH/$VENV_NAME
+ echo "Virtualenv" + $VENV_NAME + "created."
+fi
+
+if [ ! -f "$VENV_PATH/$VENV_NAME/updated" -o $BASEDIR/requirements.pip -nt $VENV_PATH/$VENV_NAME/updated ]; then
+ source $VENV_PATH/$VENV_NAME/bin/activate
+ pip install -r $BASEDIR/requirements.pip
+ touch $VENV_PATH/$VENV_NAME/updated
+ echo "Requirements installed."
+ deactivate
+fi
+set +e