install.sh 571 Bytes
Newer Older
okhin's avatar
okhin committed
1 2 3 4 5 6 7 8 9 10 11 12
#!/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
if [ -z "$CI_PROJECT_DIR" ]
then
	echo "CI_PROJECT_DIR undefined"
	exit 1
fi

export CI_PROJECT_NAME=$(basename $CI_PROJECT_DIR)

Okhin's avatar
Okhin committed
13
if [ -z "$CI_REPOSITORY_URL" ]
okhin's avatar
okhin committed
14
then
Okhin's avatar
Okhin committed
15
	echo "CI_REPOSITORY_URL undefined"
okhin's avatar
okhin committed
16 17 18 19 20 21 22 23 24
	exit 1
fi

cd /srv/piphone
if [ -d $CI_PROJECT_NAME ]
then
	cd $CI_PROJECT_NAME
	git pull origin master
else
Okhin's avatar
Okhin committed
25
	git clone $CI_REPOSITORY_URL $CI_PROJECT_NAME
okhin's avatar
okhin committed
26 27 28
	cd $CI_PROJECT_NAME
fi

29
composer install || composer update