From fef254e4f7eefc9f8e1b414c1c2f4639b963eb64 Mon Sep 17 00:00:00 2001
From: okhin <okhin@laquadrature.net>
Date: Thu, 8 Nov 2018 11:30:02 +0100
Subject: [PATCH] Update install.sh to manage home correctly

---
 ci/install.sh | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/ci/install.sh b/ci/install.sh
index 03b2ce5..7de626b 100644
--- a/ci/install.sh
+++ b/ci/install.sh
@@ -1,11 +1,19 @@
 #!/bin/bash
 # Ce script est utilisé pour paramétrer l'environnement du site
-if [ -e "./app/env" ]
+if [ 'x$PROD_HOME' -ne 'x' ]
 then
-    source app/env
+    HOME=$PROD_HOME
+else
+    HOME=/var/www/dons/
 fi
 
-cd /home/don/don
+if [ -e "$HOME/app/env"]
+    then
+        source $HOME/app/env
+    fi
+fi    
+
+cd $HOME
 git reset --hard
 git pull origin $CI_BUILD_REF_NAME
 git checkout $CI_BUILD_REF_NAME
@@ -16,7 +24,7 @@ composer install --no-dev
 composer update
 
 # Let's run the migrations
-if [ -e "phinx.yml" ]
+if [ -e "$HOME/phinx.yml" ]
 then
     case $CI_BUILD_REF_NAME in
         master)
-- 
GitLab