Continuous Integration + CruiseControl.Net + Subversion + MSBuild + .Net 2.0
I’ve read quite a bit about Continuous Integration and the .Net implementation CruiseControl.Net. It always seemed like a really good idea but I’ve never gotten around to trying it out, until now…
By the way setting up the server was a lot easier than I thought it would be! Here’s what I did:
CruiseControl.Net Setup
Download and run CruiseControl.Net setup
http://sourceforge.net/project/showfiles.php?group_id=71179&package_id=83198
I’ve used version 1.0.1:
CruiseControl.NET-1.0.1-Setup.exe
NOTE: After setup if your server has .Net 1.1 and 2.0 as mine did you may need to change the ccnet website to use .Net 2.0. This can be done through the IIS control panel, get the properties of the ccnet site and change via the ASP.NET tab.
Subversion Client
Your server will need the subversion console client on the server to allow CruiseControl to checkout your source.
.Net 2 SDK
To allow us to build .Net 2 projects without the need for Visual Studio we need to download and install .Net 2 SDK onto the server
Setup MSBuild
To use MSBuild with CC.Net we need the logger dll -ThoughtWorks.CruiseControl.MsBuild.dll from:
http://ccnetlive.thoughtworks.com/MSBuildXmlLogger%2DBuilds/
Download and copy to:
C:\Program Files\CruiseControl.NET\webdashboard\bin\
Directory structure
Setup your directory structure:
C:\CI\Myproject\
C:\CI\Myproject\build
C:\CI\Myproject\logs
Using your subversion client checkout source to C:\CI\MyProject\build
ccnet.config
Add the project config to ccnet.confg:
<cruisecontrol>
<project name="MyProject">
<!-- after a change is detected, wait 10 mins and then kick off the build-->
<schedule type="schedule" sleepSeconds="600" />
<!--set the sourcecontrol type to subversion and point to the subversion exe-->
<sourcecontrol type="svn">
<executable>C:\Program Files\Subversion\bin\svn.exe</executable>
<workingDirectory>C:\CI\MyProject\build</workingDirectory>
<trunkUrl>svn://svnserver/MyProject/trunk</trunkUrl>
<autoGetSource>true</autoGetSource>
<username>myuser</username>
<password>mypassword</password>
</sourcecontrol>
<tasks>
<!-- Configure MSBuild to compile the updated files -->c:\
<msbuild>
<executable>C:\windows\Microsoft.NET\Framework\v2.0.50727\MSBuild.exe</executable>
<workingDirectory>C:\CI\MyProject\build\src\</workingDirectory>
<projectFile>MyProject.sln</projectFile>
<buildArgs>/noconsolelogger /p:Configuration=Debug</buildArgs>
<targets></targets>
<timeout>15</timeout>
<logger>ThoughtWorks.CruiseControl.MsBuild.XmlLogger,C:\Program Files\CruiseControl.NET\webdashboard\bin\ThoughtWorks.CruiseControl.MsBuild.dll</logger>
</msbuild>
</tasks>
<!--Publishers will be done after the build has completed-->
<publishers>
<xmllogger>
<logDir>C:\CI\MyProject\Logs</logDir>
</xmllogger>
</publishers>
<modificationDelaySeconds>10</modificationDelaySeconds>
</project>
</cruisecontrol>
CC Tray
You will also want to install the CC Tray monitoring software on your pc:
It will allow you to keep an eye on the server from the comfort of your own pc.
That’s it we’re down!
Thanks, good article, to the point to get started quickly.
I’m doing something similar here, but I target a .NET 1.1 project. So I created a MSBuild proj file from scratch for my project with the right MSBee import (C# target), installed 1.1 FX, 1.1 SDK and MSBee 1.0 on top of your setup, added the switch “/p:TargetFX1_1=true” to the msbuild.buildArgs element but the problem I have is that the build process targets the .NET 1.1 environment (through MSBee) correctly… except for te Csc task!… It’s not exactly a CCNET problem because the same happens when I call MSBuild directly from the command line. Is this something you’ve tried?
Nic Daniau
21 Sep 06 at 10:26 am
5 Tips for Getting Starting with MSBuild for CruiseControl
I’ve been digging into MSBuild and its integration with CruiseControl.NET over the past week and have…
Patrick Altman
14 Nov 06 at 3:07 pm
FWIW, here is a video I made of setting up CruiseControl.NET and subversion in ten minutes.
http://www.stevetrefethen.com/blog/VideoSettingUpAContinuousIntegrationEnvironment.aspx
Steve Trefethen
19 Apr 07 at 7:58 am
How we Send NCover Output………..on My Mail??
indradev
28 Dec 07 at 2:13 pm
You might find CI Factory interesting.
http://www.cifactory.com
It will do this for you.
Jay Flowers
28 Jan 08 at 12:20 am
thanks a good article!!!!
prayag
14 May 08 at 6:12 pm
Hi .. i am using SVN over SSL (https). So what all are the things i need to do in order to get my Cruise Control.Net to working?
John Joseph M
6 Jun 08 at 9:42 am
Hi.
Anyone notice differences in the publish directory, building a sln from the IDE vs cruise control? I’m getting some dll’s in different locations (with CC is in the root and with the IDE is in bin).
Pedro Nunes
6 Nov 08 at 6:41 pm
Thanks for the post, but are you aware of just how annoying those pop-up links are?
Tim
5 Dec 08 at 4:00 pm
Hey Tim your right! I didn’t know the pop-up links were switched on, I’ve switched them off.
justinram
5 Dec 08 at 10:47 pm