Question

I want to setup a continuous integration pipeline for the first time. I have a website that includes a config file that points to MySQL and Redis. I would like to build a package once and then deploy it to test, UAT and live environments.

I don't want to rebuild the package after deploying it to each environment because it could cause inconsistencies between builds but I can't see an alternative because the config file would need to be different depending on which environment it was deployed to (the test server would be using a different database to live or UAT).

Does anyone have any ideas on how this would be possible?

Was it helpful?

Solution

You might want to look into tools like chef or puppet, as they are built for this kind of thing (provisioning). I know chef uses templates and variables in the script to substitute these. If a framework like this is unwanted you could always use a similar substitution on deploy scheme of your own or alternately expect configuration to be statically located in an externalized directory that is not effected by deploy and baked into an image for that environment or one time setup (scaling drawbacks apply).

OTHER TIPS

I've decided the best way to do this will be to delete the config file from the websites config folder.

I will then create a different config file for each environment which will be stored in puppet. Puppet can then add the correct config file into the websites config folder on provision depending on which environment it is running on.

Licensed under: CC-BY-SA with attribution
scroll top