install.sh 808 Bytes
Newer Older
1 2 3
#!/bin/bash
# Ce script est utilisé pour paramétrer l'environnement du site

4 5 6
cd /home/don/don
git pull origin $CI_BUILD_REF_NAME
git checkout $CI_BUILD_REF_NAME
7 8 9 10 11 12 13

composer install --no-dev
composer update

# Let's run the migrations
if [ -e "phinx.yml" ]
then
14
    case $CI_BUILD_REF_NAME in
15
        master)
16
            echo "master"
17
        	php vendor/robmorgan/phinx/bin/phinx migrate -e production;;
18
        preprod)
19
            echo "preprod"
20 21
        	php vendor/robmorgan/phinx/bin/phinx migrate -e development;;
    esac
22
else
23 24 25 26 27 28 29 30
    case $CI_BUILD_REF_NAME in
        master)
            echo "init master"
        	php vendor/robmorgan/phinx/bin/phinx init -e production;;
        preprod)
            echo "init preprod"
        	php vendor/robmorgan/phinx/bin/phinx init -e development;;
    esac
31 32
fi