Monday, May 2, 2011

Installing and Configuring Cruise Control .NET

Cruise Control .NET serves as a good Continuous Integration (C.I.) Server.  CCNet works with many applications and is relatively quick and easy to setup.  CCNet is primarily configured using XML.

This tutorial will outline how to install, setup, and configure a CCNet project using MSBuild. I’m installing this on a Windows 7 SP 1 instance with IIS 7 installed and CruiseControl.NET v 1.6.

  1. Download Cruise Control .NET
  2. Accept all the defaults for installation

Post Installation

Once installation is complete, do the following:

  1. Verify that the “ccnet” virtual application exists in IIS
    1. If it doesn’t create a Virtual Application underneath the Default Web Site and point it to C:\Program Files\CruiseControl.NET\webdashboard
  2. Give the “Network Service” Account both “Modify” and “Read & Execute” rights to the following folder: “C:\Program Files\CruiseControl.NET\webdashboard\packages”
    1. Note: Not doing this will give you an Access Denied error message when attempting to install packages
  3. Populate the Administrator’s password
    1. Open the dashboard.config file (C:\Program Files\CruiseControl.NET\webdashboard)
    2. Look for the following XML snippet: <administrationPlugin password="" />
    3. Populate the password string with your admin password. The password does not have any limitations other than it can’t be blank.
  1. By default, the CruiseControl.NET windows service is not started. Start it.

Once these steps are complete, you can browse to http://localhost/ccnet and should see the following screen:



Installing Packages:

  1. Click on the “Administer Dashboard” link
  2. Enter the Admin password you entered in the dashboard.config file
  3. The list of available packages to install will be on the right hand side.

Configuring of CruiseControl.Net

The project configurations and the build tasks are all configured in the ccnet.config file (C:\Program Files\CruiseControl.NET\server)

*Note that when changing this file, you need to restart the CruiseControl.NET service

Here’s an example of building one solution using MSBuild and running automated tests after the build using MSTest. (Thanks to Ben Hall for the sample file)

  <project name="HelloWorld">
        <executable> C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe</executable>
        <buildArgs>/noconsolelogger /p:Configuration=Debug</buildArgs>
        <logger>C:\Program Files\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MSBuild.dll</logger>
      <xmllogger logDir="C:\CCNet\HelloWorld\Logs" />

Additional Resources