blob: a8d620d003817433fde800ad259ebd607754ade9 [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
Matteo Scandolo56879722017-05-17 21:39:54 -070026if \
27pip install cryptography --global-option=build_ext --global-option="-L/usr/local/opt/openssl/lib" --global-option="-I/usr/local/opt/openssl/include" && \
28pip install -r $REQUIREMENTS && \
29cd $BASEDIR/lib/xos-config; python setup.py install
Matteo Scandolo297eb262017-05-15 17:00:53 -070030 then
31 echo "Requirements installed."
32 echo "Virtualenv ready"
33 else
34 echo "An error occurred"
35fi
Matteo Scandolo56879722017-05-17 21:39:54 -070036cd $BASEDIR