Closed jycamier closed 7 years ago
Symfony default composer.json comes with the command Incenteev\ParameterHandler\ScriptHandler::buildParameters which can use environment variables to build the parameters.yml file (see https://github.com/Incenteev/ParameterHandler#using-environment-variables-to-set-the-parameters).
Here's a part of the compoer.json
"extra": { "symfony-app-dir": "app", "symfony-web-dir": "web", "symfony-assets-install": "relative", "incenteev-parameters": { "file": "app/config/parameters.yml", "keep-outdated": true, "env-map": { "database_host": "DATABASE_HOST", "database_port": "DATABASE_PORT", "database_name": "DATABASE_NAME", "database_user": "DATABASE_USER", "database_password": "DATABASE_PASSWORD" } } }
And the ansible playbook exemple
--- - hosts: all gather_facts: false vars: ansistrano_deploy_from: ../my-project-checkout ansistrano_deploy_to: /home/app-user/my-project-deploy/ ansistrano_before_symlink_tasks_file: "{{playbook_dir}}/config/app_specific_setup.yml" symfony_composer_environment: DATABASE_HOST: localhost DATABASE_PORT: 3306 DATABASE_NAME: my_database DATABASE_USER: foo DATABASE_PASSWORD: bar roles: - cbrunnkvist.ansistrano-symfony-deploy
Symfony default composer.json comes with the command Incenteev\ParameterHandler\ScriptHandler::buildParameters which can use environment variables to build the parameters.yml file (see https://github.com/Incenteev/ParameterHandler#using-environment-variables-to-set-the-parameters).
Here's a part of the compoer.json
And the ansible playbook exemple