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

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

composer install --no-dev
composer update

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