3 # Script checks that venv exists. If it doesn't it will be created
4 # It requires python2.7 and virtualenv packages installed
6 # Copyright (c) 2015 Orange
7 # valentin.boucher@orange.com
9 # All rights reserved. This program and the accompanying materials
10 # are made available under the terms of the Apache License, Version 2.0
11 # which accompanies this distribution, and is available at
12 # http://www.apache.org/licenses/LICENSE-2.0
16 VENV_NAME="venv_cloudify"
17 function venv_install() {
18 if command -v virtualenv-2.7; then
20 elif command -v virtualenv2; then
22 elif command -v virtualenv; then
25 echo Cannot find virtualenv command.
30 # exit when something goes wrong during venv install
32 if [ ! -d "$VENV_PATH/$VENV_NAME" ]; then
33 venv_install $VENV_PATH/$VENV_NAME
34 echo "Virtualenv" + $VENV_NAME + "created."
37 if [ ! -f "$VENV_PATH/$VENV_NAME/updated" -o $BASEDIR/requirements.pip -nt $VENV_PATH/$VENV_NAME/updated ]; then
38 source $VENV_PATH/$VENV_NAME/bin/activate
39 pip install -r $BASEDIR/requirements.pip
40 touch $VENV_PATH/$VENV_NAME/updated
41 echo "Requirements installed."