deployer
deployer copied to clipboard
[Symfony] Add dump-env task
Add task to run dump-env on deployment
-
[ ] Bug fix #…?
-
[x] New feature?
-
[ ] BC breaks?
-
[ ] Tests added?
-
[x] Docs added?
Please, regenerate docs by running next command: $ php bin/docgen
As recommended on https://symfony.com/doc/current/deployment.html#b-configure-your-environment-variables
Run composer dump-env on every deployment.
The $APP_ENV shall be automatically when using set('dotenv', '{{deploy_path}}/shared/.env.local'); in the deploy.php file.
Kindly request review from @garak @Tobion
@richardhj Was it good idea? How can you do dump-env before composer install without symfony/flex ?
deploy:update_code
deploy:env
[development] error in symfony.php on line 69:
[development] run cd /www/hosting/xxxx/yyyy/releases/1 && (/usr/local/bin/composer dump-env "${APP_ENV:-prod}")
[development] err Command "dump-env" is not defined.
[development] exit code 1 (General error)
ERROR: Task deploy:env failed!
@richardhj Was it good idea? How can you do
dump-envbeforecomposer installwithout symfony/flex ?
dump-env is a symfony/flex utility - maybe that's the issue here?
@richardhj Was it good idea? How can you do
dump-envbeforecomposer installwithout symfony/flex ?dump-env is a symfony/flex utility - maybe that's the issue here?
Yeah, but now, deploy:env in symfony.php is rewriting the default deploy:env in common.php. That now starts even before deploy:vendors which is installing symfony/flex.
Ok, this is an ugly naming conflict that was unnoticed until now because the Symfony recipe in fact overrides the common.php's deploy task (if using the Symfony recipes, you would not use deploy:env by default).
@richardhj Was it good idea? How can you do
dump-envbeforecomposer installwithout symfony/flex ?dump-env is a symfony/flex utility - maybe that's the issue here?
Yeah, but now,
deploy:envinsymfony.phpis rewriting the defaultdeploy:envin common.php. That now starts even beforedeploy:vendorswhich is installing symfony/flex.
Which is actually a problem for us: https://github.com/deployphp/deployer/discussions/3938