From here on I'll be using a real project I have published on my public Subversion server. The project is a small Visual Studio 2005 library to liven up console applications. While the project library is perhaps tad archaic, I still have a soft spot for command-line and console-based applications.
First step is to download and install CruiseControl.NET. A word to the wise - if you are using Subversion as your source control repository, avoid using CrusieControl.NET 1.2; it has a few bugs that prevent it from operating correctly with Subversion. Thankfully, these bugs have been eradicated in the 1.2.1 release. I have installed CruiseControl.NET 1.2.1 using all of the default options.
- The configuration file for CruiseControl is usually located at C:\CruiseControl.NET\server\ccnet.config
- The subversion repository I will be using is located at svn://cognitivefusion.com/GPL
- The project I am using is under the above repository at trunk\src\CognitiveFusion.Console
<cruisecontrol>
<!-- This is your CruiseControl.NET Server Configuration file. Add your projects below! -->
<!-- <project name="MyFirstProject"> -->
</cruisecontrol>
For each project to be managed by CruiseControl, you need to add a <project> configuration block, like so:
<cruisecontrol>
<project name="CognitiveFusion.Console" />
</cruisecontrol>Next add the <sourcecontrol> configuration block to tell CruiseControl.NET where the Subversion source control repository is located:
<cruisecontrol>
<project name="CognitiveFusion.Console">
<sourcecontrol type="svn">
<trunkUrl>svn://svn.cognitivefusion.com/GPL/trunk/src</trunkUrl>
<workingDirectory>c:\Program Files\CruiseControl.NET\Builds\GPL\trunk\src</workingDirectory>
<executable>[full path to svn.exe]</executable>
</sourcecontrol>
</project>
</cruisecontrol>Assuming you are running a default Subversion install, this is all the configuration you need to have CruiseControl automatically pull the source. If you have a private subversion repository you will also need to define the <username> and <password> configuration blocks under <sourcecontrol>. To test the configuration start the CruiseControl.NET service and check the ccnet.log. If you installed the web dashboard, access it at http://localhost/ccnet.
With this minimal configuration, CruiseControl.NET will check the Subversion repository every 60 seconds for changes; tasks and publishers will execute (more on this in Part 2) when changes are detected.
In Cruising with Subversion, Part 2 we will configure MSBuild to trigger an automatic compile when CruiseControl.NET detects file changes.