2017-03-24 14:43:45 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
# The purpose of this file is to install the requirements for the docsite
|
|
|
|
# You can call it manually if running make manually, otherwise gradle will run it for you
|
|
|
|
|
|
|
|
set -xeo pipefail
|
|
|
|
|
2017-03-24 16:23:12 +00:00
|
|
|
# Install the virtualenv
|
2017-03-24 14:43:45 +00:00
|
|
|
if [ ! -d "virtualenv" ]
|
|
|
|
then
|
|
|
|
# Check if python2.7 is installed explicitly otherwise fall back to the default python
|
|
|
|
if type "python2.7" > /dev/null; then
|
|
|
|
virtualenv -p python2.7 virtualenv
|
|
|
|
else
|
|
|
|
virtualenv virtualenv
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2017-03-24 16:23:12 +00:00
|
|
|
# Activate the virtualenv
|
2017-03-24 14:43:45 +00:00
|
|
|
if [ -d "virtualenv/bin" ]
|
|
|
|
then
|
|
|
|
# it's a Unix system
|
2017-03-24 16:23:12 +00:00
|
|
|
source virtualenv/bin/activate
|
2017-03-24 14:43:45 +00:00
|
|
|
else
|
2017-03-24 16:23:12 +00:00
|
|
|
source virtualenv/Scripts/activate
|
2017-03-24 14:43:45 +00:00
|
|
|
fi
|
|
|
|
|
2017-03-24 16:23:12 +00:00
|
|
|
# Install PIP requirements
|
2017-03-24 14:43:45 +00:00
|
|
|
if [ ! -d "virtualenv/lib/python2.7/site-packages/sphinx" ]
|
|
|
|
then
|
|
|
|
echo "Installing pip dependencies ... "
|
|
|
|
pip install -r requirements.txt
|
|
|
|
fi
|