views:

552

answers:

3

What I'm looking to do is have CI and an automated build for all of my branches in a repository. I'd like each build of these web apps to have it's own project and be placed as a virtual directory (or equivalent) on a branches site. This would be great to be able to create a new branch and have it start the continuous integration and build process automatically. Adding a new virtual directory in IIS isn't a big deal, I'm ok with doing this if the rest just puts itself in place.

For Example:

http://branch.domain.com/branch101/

http://branch.domain.com/otherBranchName/

Currently, I'm using SVN, Nant and CruiseControl.Net, but I'm open another continuous integration server or build scripting if the situation demands it.

+1  A: 

I do not understand the real question. Anyway I suggest you Hudson (https://hudson.dev.java.net/).

It's easy to use. It's easy to configure with XML files. It has remote API.

ungarida
+1 for Hudson. (Beware, however: If you do builds on multiple platforms, Hudson won't proceed onto the next build until every platform is finished. That means the slowest build/test machine slows down everyone else. At least, this was the case last year when we tried it.)
sbi
Are you sure? For platform do you mean hudson job? Because you can set more then one "Build Executor". I never use it, but Hudson supports the "master/slave" mode to distribute builds.
ungarida
@ungarida: Hudson was one of the more promising CI tools we evaluated and ISTR that we abandoned it due to this. But I don't even remember what "jobs" are for Hudson anymore, so I guess this means, no, I'm not sure.
sbi
+1 Hudson - this is how we're doing CI per branch (doing branch per feature). It's around 5 minutes to set up all of our new branches and CIs for each iteration.
Jimmy Bogard
A: 

I don't think what you want as far as automatic set up of your continuous integration projects based on branching. However, if your branches are pretty standard and not changing to drastically it would be rather easy to write a powershell script (or whatever scripting languiage you prefer) to set up the new projects.

I question the need though, when we branch in CC.NET it takes less than a minute to copy the trunks projects and search and replace the needed fields. The only time we run into issues is when we have custom scripts used during the build, if those exist we need to modify those as well but that will happen with any continuous integration system.

Alex
A: 

This can be done, but alot of it is going to depend on your build scripts. If you tell cc.net to monitor the top level svn folder so for example have you project monitor:

http://myserver.com/svn/project rather than http://myserver.com/svn/project/trunk. If any changes are seen in http://myserver.com/svn/project it will kick off a build.

Now, it is up to your build script to determine what source is out of date or if there is a new branch to build. The build script would create a new VDir for any new branches.

Another option would be to have a cc.net project that was designed to do nothing other than add new projects to your cc.net. (Call it BranchBuilder project) I would leverage the pre-processor in cc.net and have a top level .config file that just included the project for trunk and each branch. The branch builder project would monitory the root path on svn. If it saw any changes it would look to see if there were any new branches since the last build. If there was one, it could create a ccnet-branchname.config file for that branch, create the vdir and then update the ccnet.config root file with an additional include.

After the ccnet config has been update cc.net will recognize the config file has been modified and reload the config adding your new branch project. That branch project would start running and build your new branch.

PilotBob
This is, in my opinion, a really bad idea. I think you're automating way too much. How much trouble could it possibly be to add a <project> block to the ccnet.config file compared to this solution?
Josh Kodroff
We do it by hand too. Just because you can do a thing, doesn't mean you should. However, it would perform the automated build for branch feature the OP asks for. That said, I don't know how often they branch. It could be dozens of times a day. Computers are designed to do repetitive tasks, right?
PilotBob