Matteo Scandolo | 297eb26 | 2017-05-15 17:00:53 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | BASEDIR=$(pwd) |
| 4 | REQUIREMENTS=$BASEDIR/containers/xos/pip_requirements.txt |
| 5 | VENVDIR=venv-xos |
| 6 | |
| 7 | echo $BASEDIR |
| 8 | echo $REQUIREMENTS |
| 9 | echo $VENVDIR |
| 10 | |
| 11 | # create venv if it's not yet there |
| 12 | if [ ! -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." |
| 17 | fi |
| 18 | |
| 19 | # activate the virtual env |
| 20 | if [ ! $VIRTUAL_ENV ]; then |
| 21 | source $BASEDIR/$VENVDIR/bin/activate |
| 22 | echo "Virtualenv activated." |
| 23 | fi |
| 24 | |
| 25 | # install pip requirements |
Matteo Scandolo | 5687972 | 2017-05-17 21:39:54 -0700 | [diff] [blame] | 26 | if \ |
| 27 | pip install cryptography --global-option=build_ext --global-option="-L/usr/local/opt/openssl/lib" --global-option="-I/usr/local/opt/openssl/include" && \ |
| 28 | pip install -r $REQUIREMENTS && \ |
| 29 | cd $BASEDIR/lib/xos-config; python setup.py install |
Matteo Scandolo | 297eb26 | 2017-05-15 17:00:53 -0700 | [diff] [blame] | 30 | then |
| 31 | echo "Requirements installed." |
| 32 | echo "Virtualenv ready" |
| 33 | else |
| 34 | echo "An error occurred" |
| 35 | fi |
Matteo Scandolo | 5687972 | 2017-05-17 21:39:54 -0700 | [diff] [blame] | 36 | cd $BASEDIR |