Question

'We're happily running Cruise Control .NET for continuous integration on our master branch in Git. We'd like to extend the number of branches under Cruise Control to cover our demo and release branches too. The issue we're facing is how do we specify different configuration files for our different branches?

The project is an ASP.NET MVC application so what we'd like to do is alter the web.config to change the database we're pointing to for each branch, plus our NUnit test config to alter the website the tests are being run against for each branch.

Ideally we'd like to be able to put something in the Cruise Control .NET config files for each branch to specify the alterations we'd like to our website configuration files. This must be a common problem and I'm wondering how this is normally achieved in Cruise Control. It's a tricky issue to search for on Google as you get lots of hits on how to configure Cruise Control but not much on how to get Cruise Control to configure other application's configuration files.

Was it helpful?

Solution

A common approach is to have all your logic in your build tool, not in your CI server.

So add all your logic to transform web.config files & co in your build tool (msbuild, FAKE, nant, psake, etc)

And then add for each branch you want to cover one project to CCNet. You can do this easily with the Configuration PreProcessor to just change the branch name with a variable and have anything else same.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top