views:

137

answers:

3

I'll keep this simple:

So, if I've got the "classic" three environments (dev/test/production), should the build script include the configurations within the deployment distribution, or is that something which should be separate and deployed separately?

Two schools of thought that I've heard:

Your artifacts should be exactly the same from environment to environment and keeping configs separate eliminates differences between deployments.

vs.

Building your configs as part of the deployment distribution is a way to test the distribution itself, and therefore, the correct approach.

A: 

I vote for keeping them together, and parameterizing the deployment set up with the environment. Been through it myself, and started off trying to deal with option 1. Kept having unexpected bugs appear in the deployment to production, because that code wasn't being tested.

Charlie Martin
+1  A: 

I agree with above, but would at that would have the config file in source such as

web.xml.DEV
web.xml.STAGING
web.XML.PRODUCTION

and then have the build process copy the appropriate file to the correct location.

Roy Rico
A: 

Use Uppercut. Then you keep ONE template file in source control, some settings files for each environment and UppercuT builds them for you automatically. Then you can use your deployment framework to select the proper one.

UppercuT uses NAnt to build and it is the insanely easy to use Build Framework.

http://code.google.com/p/uppercut/

Some good explanations here (including an explanation of ConfigBuilder): UppercuT

ferventcoder