install.sh 914 Bytes
Newer Older
1
2
#!/bin/bash
# Ce script est utilisé pour paramétrer l'environnement du site
3
if [ -e "./app/env" ]
okhin's avatar
okhin committed
4
5
6
then
    source app/env
fi
7

8
cd /home/don/don
9
git reset --hard
10
11
git pull origin $CI_BUILD_REF_NAME
git checkout $CI_BUILD_REF_NAME
Guinness's avatar
Guinness committed
12
13
git submodule init
git submodule update
14
15
16
17
18
19
20

composer install --no-dev
composer update

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