Cruise Control .net with Subversion
I’ve set up Cruise Control on my shiny new dev server, it’s running fantastically now that I have figured our how to get Cruise Control to play nicely with multiple projects in subversion. I had to use the sourcecontrol type “multi” as follows:
I couldn’t get the sourcecontrol block to work with more than one project source. Whenever I forced a build it would work but it would not work otherwise. By changing over to the type="multi"It started working properly, immediately. We had our first totally automated day of continuous integration today. It rocks. Every 60 seconds the build server checks subversion, if there’s been a checkin it does an update and does a build. every 30 seconds the ccnet system tray app on the dev desktops checks the status of the build and alerts us immediately to a failure. We then go to the Cruise Control .net dashboard and check the report for the failed build. It tells us what files changed (and therefore triggered a build) as well as showing the comments provided by the developers with their commit.
Now the plan is to continue the refactoring slowly but surely, and to also grow the nUnit tests where we can.
Nice one Mark! I’m sure this will well handy when we finally get to Subversion (soon I promise!).
Does the multi block call four different task blocks to build four different projects or does it build one master project if it detects a change in any of those repositories?
A good question, Tom. I have two solutions, and use one multi block to get the code updates for each separately, but I build the solution files for each and not the independent projects. By the build time taken I believe that the .net sdk is smart enough to only rebuild the changed projects.
Mark, I am not so sure it only builds the project that changed. The documentaion for multi-block states:
You can use the ‘Multi’ Source Control plugin to check for modifications from any number of source control repositories. You may want to do this if (for example) you want to build if the source for your project changes, or if the binaries your project depends on change (which may be stored on a file server).
This sounds to me like one project builds depending on if any repository changed. Am I reading it wrong? Plus how would you call individual taks depending on what repository changed?
I need it to work both ways, for one project I want to build one repository depending on if its’ or any other repository it depends on changed. For another project I only want the tool that changed in the tools repository to build not all tools. I am trying to do some testing but it looks like I can not access our Subversion repository this weekend. I will keep trying and post what I find.
If anybody has any suggestions I would appreciate it,
Thx
Ok, this is what I have found. The reason the code above works is because it is not using <autoGetsource%gt;true</autoGetsource%gt;. That means that you can only do development on the build box. Otherwise, you would not get changes others had committed from their own boxes. AutoGetSource gets the revision of the change that was last committed and updates the build box accordingly, but that revision # may or may not exist in the other repositories so the build will either fail or you may possibly build old code.
Mark, if you have a <tasks> that builds solution files I am going to bet that solution gets built every time a change is detected in any of the repositories, because like I said before I do not see a way to call specific <tasks> depending on what repository changed.
This is the config file I was testing with.
<sourcecontrol type=”multi”>
<sourceControls>
<svn>
<trunkUrl>http://cori-subversion/svn/test/foo2</trunkUrl>
<workingDirectory>C:\Temp\foo2</workingDirectory>
<autoGetSource>true</autoGetSource>
</svn>
<svn>
<trunkUrl>http://cori-subversion/svn/tools/foo3</trunkUrl>
<workingDirectory>C:\Temp\foo3</workingDirectory>
<autoGetSource>true</autoGetSource>
</svn>
Mark, I have a similar setup to you with Cruise Control.NET and Subversion, but I have interesting problem, so I was just wondering if you’ve had or even seen this problem. First of all in our setup we use http to access our Subversion resources.
If I have a trunk called let’s say http://localhost/repos/TestProject, now if I perform a commit at the Trunk level Cruise Control notes the change through the svn log command, but if I commit a folder under the trunk i.e. http://localhost/repos/TestProject/Folder1, Cruise Control does not detect a change through the svn log command, now I am guessing the problem is with subversion, am I correct in assuming this?
Hi Shirren,
We use many many subfolders with no issues. I also use a stock-standard svn install so I am sure it’s not a server config issue. Sounds like something funny with your folders. Have you added the actual folders to svn?
hey mark,
I am just a beginner in cruise control.NET.My doubt is that is there any way by which cruise control.NET can detect changes in the local folder itself(for eg:C:/MYSource)rather than look for changes in the source control repository.I need to force the build all the time from the web dashboard to build.I want cruise control.NEt to detect the changes and itself force the build rather than manual interference.If i can get this ine right i can with full confidence move on to source control repository.
Thanks
maddy
Hey Maddy,
It’s been three years since I wrote this post so I’m a little rusty as to exactly how to set it up – but it should work exactly as you describe… sort-of, anyway. You set it up to kick off the build scripts every n minutes, and it will only do the full build if something has changed. Otherwise it just does a “get latest” on Subversion and it sees nothing has changed.
Mark
hey mark,
Thanks for the advice,but my scneraio is somewat different.I really need to show some demo in the local hard disk and if that goes all fine i could get access to my source control repository.
Is there anyway where we can show that cruise control.NEt intergrated with nant works fine with source code at local hard disk ???
Thanks
maddy