I would like to accomplish two things during my build process:
- Run unit tests - I have a Test Project with my unit tests. I would like to run all of these tests on build and receive a notification if the build fails validation.
- Merge web.config files - I have 3 different environments with configuration details specific to each. I would like to generate the config file based on where the web application is being deployed.
I have looked over a few resources and nothing has stood out to me as the best solution for this scenario. Most of my searching revolved around the web.config portion of the goal, but if I am going to do that I'd like to accomplish the unit testing at the same time.
Scott Hanselman has a post about making multiple copies of the config file, creating custom configurations, and copying over the web.config with a batch file, aligning the configuration with the source. I don't like this solution since I have to have multiple versions of the same file and there is the chance one gets updated and another doesn't.
Using nAnt looks promising. From what I gather I would use a batch file as part of the build process. The replacing of {template} variables in the file template with variables in an xml file seems really straightforward to me, so I guess I lean towards this over MSBuild. My concern is environment configuration, multiple developers need to have the nant assemblies in the same location, so they should be checked into source control. That sounds ok with me.
I ran across CruiseControl which at first glance looks interesting, but seems like it will require a decent amount of learning.
I realize this is a pretty ambitious goal that will require some effort to get correct so I'd like to make a well informed decision before I choose a path. Any suggestions on what the easiest, cleanest way to get up and running with an automated build process with testing and file configuration would be appreciated, thank you.