diff options
| author | Florent Peyraud | 2017-07-11 10:48:10 +0200 | 
|---|---|---|
| committer | Florent Peyraud | 2017-07-11 10:48:10 +0200 | 
| commit | 485adab2f70fb071f936bb32f05fe6e0f88b6231 (patch) | |
| tree | bc0590b79652fb494e202b201724e4a08c9610d9 /install | |
| parent | 24977a51e49a3d88cf36d1fd71e2ddc51c4ec6e5 (diff) | |
| download | chouette-core-485adab2f70fb071f936bb32f05fe6e0f88b6231.tar.bz2 | |
update install scripts and tasks
Diffstat (limited to 'install')
| -rwxr-xr-x | install/deploy-helper.sh | 15 | ||||
| -rwxr-xr-x | install/stif-boiv-setup.sh | 34 | 
2 files changed, 28 insertions, 21 deletions
| diff --git a/install/deploy-helper.sh b/install/deploy-helper.sh index 5fa8efb9e..c6bed7440 100755 --- a/install/deploy-helper.sh +++ b/install/deploy-helper.sh @@ -8,6 +8,7 @@ export RUN_GROUP=src  export SUDO=""  function setup() { +    grep -q $RUN_USER /etc/passwd || exit -1      mkdir -p $BASEDIR      mkdir -p $BASEDIR/releases $BASEDIR/shared @@ -45,15 +46,16 @@ EOF      if [ ! -f database.yml ]; then          cat > database.yml <<EOF  production: -  adapter: postgresql +  adapter: postgis    encoding: unicode -  pool: 5 +  port: 5432    host: $DATABASE_HOST -  database: stif-boiv +  schema_search_path: 'public,shared_extensions'    username: stif-boiv    password: $DATABASE_PASSWORD +  postgis_schema: 'shared_extensions'  EOF      fi @@ -97,6 +99,10 @@ function install() {      mkdir -p tmp +    # merge assets with existing ones +    rsync -a public/assets/ $BASEDIR/shared/public/assets/ + +    # relink shared dirs      for directory in public/uploads tmp/uploads public/assets; do          local_directory=$BASEDIR/shared/$directory          release_directory=$directory @@ -105,6 +111,7 @@ function install() {          ln -s $local_directory $release_directory      done +    # relink shared files      for file in secrets.yml database.yml environments/production.rb initializers/sidekiq.rb; do          local_file=$BASEDIR/shared/config/$file          release_file=config/$file @@ -118,5 +125,5 @@ function install() {  command=$1  shift -set -x +#set -x  $command $@ diff --git a/install/stif-boiv-setup.sh b/install/stif-boiv-setup.sh index 25b1882e5..329bffd9c 100755 --- a/install/stif-boiv-setup.sh +++ b/install/stif-boiv-setup.sh @@ -19,10 +19,9 @@ else    exit -2  fi -exit 0  # mandatory packages and distribution upgrade  apt-get update && apt-get dist-upgrade -apt-get install -y wget sudo +apt-get install -y wget sudo build-essential  # ruby  echo "==== Installation de Ruby 2.3" @@ -81,28 +80,29 @@ fi  # NodeJS -if test "$SVRTYPE" == "front"; then -echo "==== Installation de NodeJS 5.x" -apt-get install -y apt-transport-https - -cat > /etc/apt/sources.list.d/nodesource.list <<EOF -deb https://deb.nodesource.com/node_5.x  jessie main -EOF - -wget -q -O - https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - -apt-get update - -apt-get install -y nodejs -fi +#if test "$SVRTYPE" == "front"; then +#echo "==== Installation de NodeJS 5.x" +#apt-get install -y apt-transport-https +# +#cat > /etc/apt/sources.list.d/nodesource.list <<EOF +#deb https://deb.nodesource.com/node_5.x  jessie main +#EOF +# +#wget -q -O - https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - +#apt-get update +# +#apt-get install -y nodejs +#fi  # Configuration de l'applicatif  echo "==== Paramétrage de l'applicatif" -echo -n "Veuillez saisir à nouveau le mot de passe d'accès à la base de données :" +echo -n "Veuillez saisir le mot de passe d'accès à la base de données :"  read -s DATABASE_PASSWORD +echo ''  export DATABASE_PASSWORD -PGPASSWORD=$DATABASE_PASSWORD PGHOST=$DATABASE_HOST PGUSER=stif_boiv psql -q -c 'select 1' stif_boiv >/dev/null 2>&1 && echo "Mot de passe PG correct"  +PGPASSWORD=$DATABASE_PASSWORD PGHOST=$DATABASE_HOST PGUSER=stif_boiv psql -q -c 'select 1' stif_boiv >/dev/null 2>&1 && echo "Mot de passe PG correct" || echo "ATTENTION : connexion impossible"  ./deploy-helper.sh setup | 
