Search code examples
phpshellsymfonyamazon-web-servicesaws-code-deploy

How to deploy Symfony app in AWS Code Deploy using Github?


I am using AWS Code Deploy to deploy a Symfony project to an autoscaling group consisting of multiple EC2 instances. Currently I deploy revisions for my application using the S3 file upload option, however I would prefer being able to deploy directly from Github.

The problem I have is what to do about the parameters.yml file? It contains a variety of sensitive information required for the application to run. I therefore don't want to push a production configuration of the parameters.yml into remote repo, for a number of reasons.

What would you recommend doing?

I was wondering if I can write a shell script which is executed AfterInstall and copies across the prod parameters.yml from a s3 bucket?


Solution

  • The current best practice in symfony is to use environment variables, see doc for more information. And I found this question with hints for setting the variables.