2019-04-17 17:27:19 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
ninegate_synceportail=$(CreoleGet ninegate_synceportail non)
|
|
|
|
moderegistration=$(CreoleGet ninegate_moderegistration none)
|
|
|
|
labelsniveau01=$(CreoleGet ninegate_niveau01labels non)
|
|
|
|
iconniveau01=$(CreoleGet ninegate_niveau01icon non)
|
|
|
|
affniveau02=$(CreoleGet ninegate_niveau02view non)
|
|
|
|
labelsniveau02=$(CreoleGet ninegate_niveau02labels non)
|
|
|
|
iconniveau02=$(CreoleGet ninegate_niveau02icon non)
|
2019-07-16 12:10:32 +02:00
|
|
|
weburl=$(CreoleGet web_url non)
|
2019-07-23 15:32:35 +02:00
|
|
|
ninegate_websocket=$(CreoleGet ninegate_activate_websocket non)
|
|
|
|
websocket_url=$(CreoleGet adresse_ip_eth0 non)
|
|
|
|
websocket_portinterne=$(CreoleGet ninegate_websocket_portinterne non)
|
2019-04-17 17:27:19 +02:00
|
|
|
|
|
|
|
www_dir="$container_path_web/var/www/html"
|
|
|
|
eportail_dir="$www_dir/eportail"
|
|
|
|
|
2019-11-25 14:26:26 +01:00
|
|
|
# Récuper les composer associés à la version de php installé
|
|
|
|
version72=`php -r 'echo version_compare(phpversion(), "7.2.0", ">=");'`
|
|
|
|
if [[ "$version72" == "1" ]]
|
|
|
|
then
|
2019-11-25 14:37:41 +01:00
|
|
|
cp -rf /var/www/html/ninegate/scripts/php72/composer.json /var/www/html/ninegate/composer.json
|
|
|
|
cp -rf /var/www/html/ninegate/scripts/php72/composer.lock /var/www/html/ninegate/composer.lock
|
2019-11-25 14:26:26 +01:00
|
|
|
else
|
|
|
|
version70=`php -r 'echo version_compare(phpversion(), "7.0.0", ">=");'`
|
|
|
|
if [[ "$version70" == "1" ]]
|
|
|
|
then
|
|
|
|
cp -rf /var/www/html/ninegate/scripts/php70/composer.json /var/www/html/ninegate/composer.json
|
|
|
|
cp -rf /var/www/html/ninegate/scripts/php70/composer.lock /var/www/html/ninegate/composer.lock
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2019-04-17 17:27:19 +02:00
|
|
|
# Installation des dépendances composer
|
|
|
|
composer install
|
2020-03-03 11:03:18 +01:00
|
|
|
rm -f /var/www/html/ninegate/var/logs/dev.log
|
2019-04-17 17:27:19 +02:00
|
|
|
|
|
|
|
# Permissions
|
|
|
|
./perm.sh www-data
|
|
|
|
|
|
|
|
# Nettoyage du cache
|
2019-11-25 14:37:41 +01:00
|
|
|
rm /var/www/html/ninegate/var/cache -rf
|
2019-04-17 17:27:19 +02:00
|
|
|
php bin/console cache:clear --env=prod --no-debug
|
|
|
|
|
|
|
|
# Migration si nécessaire du schéma de la base
|
|
|
|
php bin/console doctrine:schema:update --force --env=prod --no-debug
|
|
|
|
|
|
|
|
# Insertion data de base
|
2020-03-03 11:03:18 +01:00
|
|
|
php bin/console Core:InitData --env=prod
|
|
|
|
php bin/console Cron:InitData --env=prod
|
|
|
|
php bin/console Portal:InitData --env=prod
|
2019-04-17 17:27:19 +02:00
|
|
|
|
2020-04-15 10:43:15 +02:00
|
|
|
# Passage des scripts
|
|
|
|
php bin/console Core:Script --env=prod
|
|
|
|
|
2019-04-17 17:27:19 +02:00
|
|
|
# Generation des assets
|
2020-03-03 11:03:18 +01:00
|
|
|
bin/console assetic:dump --env=prod
|
2019-04-17 17:27:19 +02:00
|
|
|
|
|
|
|
# Copie des polices du projet dans le rep web
|
|
|
|
cp -rf src/Cadoles/CoreBundle/Resources/public/fonts web/
|
|
|
|
|
|
|
|
# Pointer le repertoire des avatar d'eportail sur celui de draaf
|
|
|
|
# Paramétrage eportail
|
|
|
|
if [[ "$ninegate_synceportail" = 'oui' ]]
|
|
|
|
then
|
|
|
|
if [[ ! -L /var/www/html/eportail/local/images/avatar ]]
|
|
|
|
then
|
|
|
|
rm -rf /var/www/html/eportail/local/images/avatar
|
|
|
|
ln -s /var/www/html/ninegate/web/uploads/avatar /var/www/html/eportail/local/images/avatar
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Permissions
|
|
|
|
./perm.sh www-data
|
|
|
|
|
2019-07-16 12:10:32 +02:00
|
|
|
# Server Websocket
|
2019-07-23 15:32:35 +02:00
|
|
|
if [[ "$ninegate_websocket" = 'oui' ]]
|
|
|
|
then
|
2019-09-19 13:46:25 +02:00
|
|
|
/var/www/html/ninegate/scripts/ninegate-websocket.sh
|
2019-07-23 15:32:35 +02:00
|
|
|
fi
|