Commit 2842bf7a authored by Imre Jonk's avatar Imre Jonk

Update CI script to differentiate between branches

parent e1599e20
......@@ -4,6 +4,8 @@ before_script:
- 'which curl ||(apt-get update -yq && apt-get install curl -yqq)'
job 1:
variables:
- GIT_BRANCH: 'master'
script:
- chmod a+x ci/install.sh
- ./ci/install.sh
......@@ -13,6 +15,8 @@ job 1:
- master
job 2:
variables:
- GIT_BRANCH: 'develop'
script:
- chmod a+x ci/install.sh
- ./ci/install.sh
......
......@@ -4,26 +4,27 @@
# We need those variables
if [ -z "$CI_PROJECT_DIR" ]
then
echo "CI_PROJECT_DIR undefined"
exit 1
echo "CI_PROJECT_DIR undefined"
exit 1
fi
export CI_PROJECT_NAME=$(basename $CI_PROJECT_DIR)
if [ -z "$CI_BUILD_REPO" ]
then
echo "CI_BUILD_REPO undefined"
exit 1
echo "CI_BUILD_REPO undefined"
exit 1
fi
cd /srv/piphone
if [ -d $CI_PROJECT_NAME ]
then
cd $CI_PROJECT_NAME
git pull origin master
cd $CI_PROJECT_NAME
git pull origin $GIT_BRANCH
else
git clone $CI_BUILD_REPO $CI_PROJECT_NAME
cd $CI_PROJECT_NAME
git clone $CI_BUILD_REPO $CI_PROJECT_NAME
cd $CI_PROJECT_NAME
git checkout $GIT_BRANCH
fi
composer install || composer update
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment