YOUR FEEDBACK
Adobe Flex 2 - Answering Tough Questions About Enterprise Development
A Correct Person wrote: Denis Roebrt commented on the 21 Aug 2006 "Tough Que...

SYS-CON.TV
TOP MICROSOFT .NET LINKS


Put Your Next Project on Cruise Control
Make your projects build themselves

Digg This!

Page 2 of 2   « previous page

There are many other options available for the subversion source control block and we'll cover some of those in parts two and three of this series. We'll also cover some special considerations when using svn+ssh style authentication.

Building the Bits
Once the source code is checked out, CCNet will run through the defined set of tasks. As with source control, a number of different task element types are available, including executable, NAnt, Visual Studio, NUnit, file merge, and many others. We'll cover the file merge, NUnit, and Visual Studio tasks in parts two and three, but for now we'll just focus on the NAnt and exec tasks. For those who might not be aware, NAnt is the .NET-based sibling of the popular Java-based build management tool Ant. It uses XML-based build files that are roughly equivalent to makefiles. The NAnt CCNet task is used to execute a NAnt build file on our source tree. Here is the part of the ccnet.config file that specifies how to run a NAnt build file as part of our project.


<nant>
<executable>c:\program files\nant\bin\nant.exe</executable>
<baseDirectory>c:\dev\example1</baseDirectory>
<buildArgs></buildArgs>
<buildFile>example1.build</buildFile>
<targetList>
<target>go</target>
</targetList>
<buildTimeoutSeconds>1800</buildTimeoutSeconds>
</nant>
The parts to understand about this fragment are the buildFile, targetList, and buildTimeoutSeconds elements. The buildFile element specifies the name of the NAnt build file to use. Note that in this example we don't include any path information with the build file so it expects to find the file in the baseDirectory path. The targetList element specifies the list and the order of targets that will be built during this execution. Just as in a makefile target, a NAnt target specifies how source code gets turned into output files. For more information on NAnt and its usage, please see http://nant.sourceforge.net/. The buildTimeoutSeconds element speci-fies how many seconds CCNet will allow the NAnt task to exe-cute before it terminates it. This prevents a hung task from bringing the entire build process to a halt.

For those situations where we don't want to use NAnt, we can use the exec task. Perhaps we have an existing project that builds from a makefile. Rather than convert the project to using NAnt, use the exec task to execute NMake and process the existing makefile. Here's how it might look:


<tasks>
<exec>
<executable>nmake</executable>
<baseDirectory>c:\dev\example1</baseDirectory>
<buildArgs>all</buildArgs>
<buildTimeoutSeconds>60</buildTimeoutSeconds>
</exec>
</tasks>
What Happened?
No matter what tasks you use in your CI setup, it's important to find out the results of those tasks. This is handled using the publisher tasks. The important thing to remember is that the Web dashboard uses an XML-based log file to report results so every project should include an Xml Log Publisher task. This is defined using the xmllogger element as in the following example:

<publishers>
    <xmllogger logDir="c:\dev\example1\logs"/>
</publishers>

The Xml Log Publisher is so important to the publishing aspect of CCNet that if you don't specify one, the Web dashboard will not function correctly, so you should always include this in your project. You don't have to specify a logDir for your Xml Log Publisher. If you don't, the logs will be saved under the CCNet install directory.

The Web Dashboard
The Web dashboard is a simple Web application that can be used to monitor build status and progress via a Web browser. By default it gets installed under the CCNet virtual directory, so if your build machine were named "builder," you could open your browser to http://builder/ccnet and view the status of your CCNet projects. You can also view the logs for the projects and force rebuilds.

Getting Notified
CCTray is a handy little tool that allows us to keep tabs on our projects without having to keep the Web dashboard loaded into a browser. CCTray is a .NET app that sits in your system tray and monitors one or more CCNet installations and lets your know the current status by changing the color of the CCTray icon along with optional audible cues. You should note that CCTray is a separate download from the main CCNet installer and it should be installed on any machine from which you want to monitor your projects.

Our Setup
There's a great simplicity that comes from having a separate build machine that is constantly monitoring a source repository, checking out the latest bits, compiling them on every runtime, and executing a set of unit and regression tests. Here at MySQL, we use CruiseControl for our Java work and CruiseControl.NET for our .NET work. Each team is working to integrate the output of our various build tools into the CI build log, not only for our benefit, but to include in our project packages as well. By using CruiseControl we can not only publish the build success or failure of each project, but other data points as well such as unit test success or failure, code metrics, coverage analysis, coding rule analysis (i.e., FxCop), performance and profiling data, and others.

Looking Forward
In this first part we have taken a look at a basic CruiseControl.NET setup that makes use of NAnt and Subversion. In the next install-ment, we'll focus on integrating tools such as FxCop and NCover into our CCNet setup. In the final installment, we'll look at extending our CI setup to include Linux and Mono.


Page 2 of 2   « previous page

About Reggie Burnett
Reggie Burnett is a .NET architect for MySQL, Inc. Reggie wrote the original ByteFX ADO.NET provider for MySQL and currently maintains that code under its current name of MySQL Connector/Net.

Enrico wrote: Pity that the following articles don't seem to exist, and that the 'excellent online documentation,' at least at sourceforge, is also mostly missing. :P
read & respond »
SOA Web Services Journal News Desk wrote: 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.
read & respond »
.NET News Desk wrote: 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.
read & respond »
MICROSOFT .NET LATEST STORIES
Icahn Moves To Force Microsoft & Yahoo Together
Corporate raider Carl Icahn started his proxy fight for control of Yahoo this morning, beginning with the classic Icahn opening, the letter of reproach to the Yahoo board telling them they have acted 'irrationally and lost the faith of shareholders and Microsoft.'
IBM, Microsoft & Google Eras of Computing
By now it is conventional wisdom to say that there was an IBM Era of computing, then a Microsoft Era, and now we are in the Google Era. In this post, I will explain why Microsoft was not the 'next IBM' and why Google is not the 'next Microsoft' - there are significant qualitative diffe
Book Review: ASP.NET 2.0
ASP.NET developers are bored with traditional books that outline concepts in a lengthy way. These books are good if you like to learn the features in a detailed manner. However, by the time the book is read, a new version will be released. Hence, many learners including myself prefer s
3rd International Virtualization Conference & Expo: Themes & Topics
From Application Virtualization to Xen, a round-up of the virtualization themes & topics being discussed in NYC June 23-24, 2008 by the world-class speaker faculty at the 3rd International Virtualization Conference & Expo being held by SYS-CON Events in The Roosevelt Hotel, in midtown
"RIA" vs "Rich Client Platform": The Term Is Now Up for Debate
'RIA' is slowly fading in terms of its definition. When I first started the RIA Evangelism role in Microsoft, I had this nagging feeling that the term RIA was just all over the place. Depending on which technology you are backing and which stream of alliance you uphold, the truth is th
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS
SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021

SYS-CON FEATURED WHITEPAPERS

ADS BY GOOGLE
BREAKING NEWS FROM THE WIRES
Strangeloop Networks Selected for Red Herring 100 North America 2008
Strangeloop Networks (TM) Inc., a leading provider of solutions that accelerate dynamic web