Feature: trigger migration automatically only in prod mode

This commit is contained in:
Julien Fastré 2023-01-13 13:26:10 +01:00
parent dc19006738
commit 99ec0b765f
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB

View File

@ -36,6 +36,12 @@ fi
if [ "${APP_ENV}" = "prod" ]; then
composer dump-env "${APP_ENV}"
chmod +r /var/www/app/.env.local.php
if [ "${PREVENT_MIGRATIONS}" != "true" ]; then
php /var/www/app/bin/console doctrine:migrations:status
php /var/www/app/bin/console doctrine:migrations:migrate -n
php /var/www/app/bin/console messenger:setup-transports
fi
fi
if [ "${CLEAR_CACHE}" != "false" ]; then
@ -45,11 +51,5 @@ if [ "${CLEAR_CACHE}" != "false" ]; then
chgrp ${PHP_FPM_GROUP} /var/www/app/var/log -R && chmod g+rw /var/www/app/var/log -R
fi
if [ "${PREVENT_MIGRATIONS}" != "true" ]; then
php /var/www/app/bin/console doctrine:migrations:status
php /var/www/app/bin/console doctrine:migrations:migrate -n
php /var/www/app/bin/console messenger:setup-transports
fi
exec "${@}"