aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorent Peyraud2017-07-11 10:48:10 +0200
committerFlorent Peyraud2017-07-11 10:48:10 +0200
commit485adab2f70fb071f936bb32f05fe6e0f88b6231 (patch)
treebc0590b79652fb494e202b201724e4a08c9610d9
parent24977a51e49a3d88cf36d1fd71e2ddc51c4ec6e5 (diff)
downloadchouette-core-485adab2f70fb071f936bb32f05fe6e0f88b6231.tar.bz2
update install scripts and tasks
-rwxr-xr-xinstall/deploy-helper.sh15
-rwxr-xr-xinstall/stif-boiv-setup.sh34
-rw-r--r--lib/tasks/install.rake1
3 files changed, 29 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
diff --git a/lib/tasks/install.rake b/lib/tasks/install.rake
index 5e41fa2af..ccc6f2450 100644
--- a/lib/tasks/install.rake
+++ b/lib/tasks/install.rake
@@ -10,6 +10,7 @@ task :package do
sh "bundle exec rake assets:clobber RAILS_ENV=production"
sh "bundle exec rake assets:precompile RAILS_ENV=production"
sh "tar -rf tmp/package/stif-boiv-release-#{release_name}.tar vendor/cache"
+ sh "tar -rf tmp/package/stif-boiv-release-#{release_name}.tar public/assets"
%w{deploy-helper.sh README sidekiq-stif-boiv.service stif-boiv.conf stif-boiv-setup.sh template-stif-boiv.sql}.each do |f|
cp "install/#{f}", "tmp/package/#{f}"