#!/bin/bash

#
# Install teuthology and the packages required by teuthology.
#
git submodule sync
git submodule update --force --init --recursive
rm -fr virtualenv .tox
( cd teuthology ; git clean -ffqdx ; ./bootstrap install )
virtualenv virtualenv
source virtualenv/bin/activate
pip install -r requirements.txt -r test-requirements.txt
pip install tox
python setup.py develop
teuthology_path=$(pwd)/teuthology/virtualenv/bin
if ! echo $PATH | grep --quiet $teuthology_path ; then
   export PATH=$teuthology_path:$PATH
fi
teuthology_pythonpath=$(pwd)/teuthology
if ! echo $PYTHONPATH | grep --quiet $teuthology_pythonpath ; then
   export PATH=$teuthology_pythonpath:$PATH
fi
