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:

clip_image002

 

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)

<cruisecontrol>
  <project name="HelloWorld">
    <artifactDirectory>C:\CCNet\HelloWorld\Artifacts</artifactDirectory>
    <tasks>
      <msbuild>
        <executable> C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe</executable>
        <workingDirectory>E:\CCNet\HelloWorld\Build\src\</workingDirectory>
        <projectFile>HelloWorld.sln</projectFile>
        <buildArgs>/noconsolelogger /p:Configuration=Debug</buildArgs>
        <logger>C:\Program Files\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MSBuild.dll</logger>
        <timeout>900</timeout>
      </msbuild>
    </tasks>
    <publishers>
      <xmllogger logDir="C:\CCNet\HelloWorld\Logs" />
    </publishers>
     <modificationDelaySeconds>10</modificationDelaySeconds>
  </project>
</cruisecontrol>

Additional Resources

5 comments:

  1. Note you have to have the ASP.NET component enabled in IIS - just having IIS7 installed is not enough and ASP.NET is not enabled by default when you enable IIS.

    ReplyDelete
  2. The Cruise Control .Net project is now at http://www.cruisecontrolnet.org/

    ReplyDelete
  3. On Windows 7 and IIS 7.0. I had to give Read/Write permissions to packages.xml file to "Everyone" to resolve the following issues.

    Access to the path 'C:\Program Files\CruiseControl.NET\webdashboard\Packages\packages.xml' is denied

    ReplyDelete
  4. the installation procedure which is step by step and very clear.
    Thanks.
    http://www.indiumsoft.com/core-qa-offerings/test-automation

    ReplyDelete