Home > General > Continuous Integration + CruiseControl.Net + Subversion + MSBuild + .Net 2.0

Continuous Integration + CruiseControl.Net + Subversion + MSBuild + .Net 2.0

20 July, 2006

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.

http://subversion.tigris.org/

.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

http://www.microsoft.com/downloads/details.aspx?familyid=fe6f2099-b7b4-4f47-a244-c96d69c35dec&displaylang=en

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:

CCTray

It will allow you to keep an eye on the server from the comfort of your own pc.

That’s it we’re down!

Advertisements
Categories: General
  1. Nic Daniau
    21 September, 2006 at 10:26 am

    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?

  2. 19 April, 2007 at 7:58 am

    FWIW, here is a video I made of setting up CruiseControl.NET and subversion in ten minutes.

    http://www.stevetrefethen.com/blog/VideoSettingUpAContinuousIntegrationEnvironment.aspx

  3. indradev
    28 December, 2007 at 2:13 pm

    How we Send NCover Output………..on My Mail??

  4. 28 January, 2008 at 12:20 am

    You might find CI Factory interesting.
    http://www.cifactory.com

    It will do this for you. 🙂

  5. prayag
    14 May, 2008 at 6:12 pm

    thanks a good article!!!!

  6. John Joseph M
    6 June, 2008 at 9:42 am

    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?

  7. Pedro Nunes
    6 November, 2008 at 6:41 pm

    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).

  8. Tim
    5 December, 2008 at 4:00 pm

    Thanks for the post, but are you aware of just how annoying those pop-up links are?

  9. 5 December, 2008 at 10:47 pm

    Hey Tim your right! I didn’t know the pop-up links were switched on, I’ve switched them off.

  1. 14 November, 2006 at 3:07 pm
Comments are closed.
%d bloggers like this: