Eolisation de l'applicatif MSE
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

mse-scribe-post-install.sh 2.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #!/bin/bash
  2. cd /var/www/html/mse
  3. # Dépendences Deb
  4. declare -a deps=("php5.6-intl" "php-ssh2")
  5. for i in "${deps[@]}"
  6. do
  7. if [ $(dpkg-query -W -f='${Status}' "$i" 2>/dev/null | grep -c "ok installed") -eq 0 ];
  8. then
  9. apt-get install -y "$i";
  10. fi
  11. done
  12. %for %%server in %%getVar('pvebundle_redisalias', [])
  13. redis-cli -h %%server.pvebundle_redisserveur -p %%server.pvebundle_redisport flushall
  14. %end for
  15. # Nettoyage du cache
  16. php app/console cache:clear --env=prod --no-debug
  17. #php -r "apc_clear_cache(); apc_clear_cache('user'); apc_clear_cache('opcode');"
  18. php app/console cache:warmup --env=prod --no-debug
  19. # Réinitialisation des droits
  20. mkdir -p app/{cache,logs,spool,webservices,uploads}
  21. chown -R :www-data app/{cache,logs,spool,webservices}
  22. chmod -R g+rw app/{cache,logs,spool,webservices}
  23. %if %%is_defined('is_mse_master') and %%is_mse_master == "oui"
  24. # Affichage du status des migrations
  25. # php app/console doctrine:schema:update --force --env=prod --no-debug
  26. php app/console doctrine:migrations:status --show-versions
  27. # Initialisation des tâches cron de base du PVE
  28. php app/console pve:init:cron --env=prod --no-debug
  29. jobs_error_log="/var/www/html/mse/app/logs/jobs-error.log"
  30. # Enregistrement du gestionnaire des jobs dans les tâches cron du système
  31. echo "* * * * * root cd /var/www/html/mse; php app/console pve:jobs:run --env=prod --no-debug > /dev/null 2>>${jobs_error_log}" > /etc/cron.d/pve-jobs-run
  32. echo "1 0 * * * root cd /var/www/html/mse; ./scripts/send-ine-report.sh > /dev/null 2>>${jobs_error_log}" > /etc/cron.d/pve-ine-report
  33. # RT#1260, export et upload des données IZLY
  34. echo "0 3 * * * root cd /var/www/html/mse; ./scripts/izly-export-daily-accounts.sh --prod 2>&1 1>>${jobs_error_log}" > /etc/cron.d/pve-izly-export-daily-accounts
  35. # RT#1259, download et import des données IZLY
  36. echo "0 4 * * * root cd /var/www/html/mse; ./scripts/izly-import-daily-accounts.sh --prod 2>&1 1>>${jobs_error_log}" > /etc/cron.d/pve-izly-import-daily-accounts
  37. %end if
  38. # # FIX problème doctrine https://github.com/doctrine/doctrine2/issues/6884
  39. diff -u vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php patch/UnitOfWork.fixed.php > patch/doctrine.patch
  40. patch vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php < patch/doctrine.patch
  41. rm patch/doctrine.patch
  42. # ./scripts/import-texts.sh --env=prod --no-debug
  43. # ./scripts/import-settings.sh --env=prod --no-debug