|
YOUR FEEDBACK
|
TOP MICROSOFT .NET LINKS Tools Put Your Next Project on Cruise Control
Make your projects build themselves
By: Reggie Burnett
Nov. 7, 2005 10:15 AM
This article is the first in a three-part series on the use of CruiseControl.NET, a very popular and important tool for any development house interested in implementing continuous integration and other agile programming concepts. In this first installment we'll briefly cover the definition and use of continuous integration (CI), some of the other CI tools available, and the basic setup and operation of CruiseControl.NET. While these articles will cover the core elements of CruiseControl.NET, we will be covering only a small portion of its functionality and you are encouraged to read through the excellent online documentation.
Continuous integration is especially well suited for development teams. Most of us have had the unfortunate experience of working for several days on a key feature until it works perfectly, only to find out that it no longer works with fresh builds of the other components. If we are lucky, the failure will be obvious such as a compiler error. If we're not so lucky, it will appear to work only to fail later during release testing. I know what you're thinking. You're thinking that all you need is a good set of integration tests and you'll just run those tests before you commit your changes. That can work, but then you'll need to run those tests for every commit because even the smallest change can break the build. Oh, and don't forget to run those tests on every .NET platform available, including Mono. And don't forget about the 64-bit variants of those platforms. You get the idea. Computers are excellent tools for doing repetitive tasks and letting us know what happened. Enter your favorite continuous integration tool, stage left.
But I'm A Single Developer As we'll see in parts two and three, the CI build process can be extended to include all sorts of tools that help us monitor the health and quality of our code.
Ok, I Get It. CruiseControl is distributed under the ThoughtWorks Open Source Software License, which is similar to the Apache and BSD licenses. The latest bits, release notes, and installation instructions can be found at http://confluence.public.thoughtworks.org/display/CCNET/Download.
Basic Setup of Cruise Control .NET Now that you've decided where CCNet should live, installation is as simple is running the CCNet installer. In the typical configuration you'll get a stand-alone version and a service-based version, along with a Web application that can be used to monitor the build processes. The stand-alone version, ccnet.exe, is most useful for debugging your configuration script (be sure to stop the CruiseControl.NET service first). You should use the stand-alone version while you are creating or modifying the config file since any errors will be output to the console, and because debugging is very easy and fast. Once the project is building cleanly you can move to using the service binary. Once installed, the next step is to edit the ccnet.config file. This XML file defines the projects and their options and normally resides in the server directory inside the CCNet installation directory. Each project that you want to control should be defined using a <project> element. CCNet has many features and options, but each project boils down to three basic actions: get code, act on code, and report on the results of those actions. As you can see from the following example, each of these actions maps to an element in the config file. We'll take each one of these sections and briefly describe its basic usage, thereby working our way to a fully functioning CCNet setup.
Starting an Integration
<project name="Example1"> The buildCondition attribute value "IfModificationExists" indicates that the integration should only happen if CCNet has detected that source code changes have occurred. A value of "ForceBuild" will build on the given interval in any case.
Getting the Latest Bits To specify the source control settings, use the sourcecontrol element. Consider the following: This fragment specifies that we are using Subversion (type = "svn") and gives the repository URL using the trunkUrl element. The code found at that repository will be checked out and placed in the directory specified with the workingDirectory element. You can use the username and password elements to specify your authentication credentials for the repository. The tagOnSuccess element is used to tag the Subversion repository after a successful integration. YOUR FEEDBACK
MICROSOFT .NET LATEST STORIES
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
|
SYS-CON FEATURED WHITEPAPERS MOST READ THIS WEEK BREAKING NEWS FROM THE WIRES
|
||||||||||||||||||||||||||||||||||||||||||||