install.sh 572 Bytes
Newer Older
okhin's avatar
okhin committed
1 2 3 4
#!/usr/bin/bash
# This schript is used to setup what needs to be (virtualenv and stuff)
# before running the pthon setup.py part
# We need those variables
okhin's avatar
okhin committed
5 6
[[ -z "$CI_PROJECT_NAME" ]] && exit 1
[[ -z "$CI_BUILD_REPO" ]] && exit 1
okhin's avatar
okhin committed
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22

cd /srv/piphone
if [ -d $CI_PROJECT_NAME ]
then
	cd $CI_PROJECT_NAME
	git pull origin master
else
	git clone $CI_BUILD_REPO $CI_PROJECT_NAME
	cd $CI_PROJECT_NAME
fi
if [ ! -d ./.${CI_PROJECT_NAME}_env ]
then
	virtualenv --python=python3 .${CI_PROJECT_NAME}_env
fi
source .${CI_PROJECT_NAME}_env/bin/activate
pip install -r ./requirements.txt