blob: 8c5f50d94c4a75eca7bdc1c21f597e661faea362 [file] [log] [blame]
Matteo Scandolo297eb262017-05-15 17:00:53 -07001#!/bin/bash
2
3BASEDIR=$(pwd)
4REQUIREMENTS=$BASEDIR/containers/xos/pip_requirements.txt
5VENVDIR=venv-xos
6
7echo $BASEDIR
8echo $REQUIREMENTS
9echo $VENVDIR
10
11# create venv if it's not yet there
12if [ ! -d "$BASEDIR/$VENVDIR" ]; then
13 echo "Setting up virtualenv for XOS"
14 virtualenv -q $BASEDIR/$VENVDIR --no-site-packages
15 pip install --upgrade pip
16 echo "Virtualenv created."
17fi
18
19# activate the virtual env
20if [ ! $VIRTUAL_ENV ]; then
21 source $BASEDIR/$VENVDIR/bin/activate
22 echo "Virtualenv activated."
23fi
24
25# install pip requirements
26if pip install -r $REQUIREMENTS
27 then
28 echo "Requirements installed."
29 echo "Virtualenv ready"
30 else
31 echo "An error occurred"
32fi