install.sh 865 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
Guinness's avatar
Guinness committed
8 9
git submodule init
git submodule update
10 11 12 13 14 15 16

composer install --no-dev
composer update

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