Ship config for every environment with each application.
How
- Get your continuous intergration server to build all your applications without tieing them to one environment. Package all configs for each application together with the application.
- Write a deployment tool that takes your build artifact for an application and deploys it into an environment.
- Either get the deployment tool to select the correct config for that environment or even better, somehow get the environment to select it's own config.
- Extend your deployment tool to take your application from any environment and deploy it to a different environment. As all configs travel with the application this is trivial.
Pros
- You can promote to production from uat without having a seperate build.
- You can run your prod code in uat safely as it's uat configuration is easily available (without trauling through svn).
- Your continuous intergration server doesn't have to create a zip of each app for each environment - it zips once per app, keeping a quick build / test cycle.
- Uses a lot less disk space than separate app / env zips.
- Not as easy to just take a raw artifact from cruise and use it.
A. For sensitive values, have variables in your config that are resolved at runtime by a local environment config file. As this file should not be under version control, it should contain as little config as possible, with the main config being shipped with the app.
2 comments:
One major advantage also (as you know) is that you can 100% gaurantee that the code that has been run in UAT is the _exact_ code that will run in PROD. Now, if only we didn't have to write our own configuration system for this in .NET I would be a happy man. I mean come on Microsoft: 1 app.config to rule them all. Oh, that was so like...2002.
And again - same pattern, different bank.
Post a Comment