YOUR FEEDBACK
José D'Andrade wrote: "...it may never be released..." Why? "...if Midori isn’t heir to Windows Mi...

SYS-CON.TV
TOP MICROSOFT .NET LINKS


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

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.

So What Is Continuous Integration?
In brief, it's the process of integrating the various components of a software project on a regular and frequent basis to enable early detection of problems along component boundaries. For a much better read on the structure and benefits of continuous integration, check out this essay from Martin Fowler and Matthew Foemmel (www.martinfowler.com/articles/continuousIntegration.html).

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
Some argue that single developers have little or no need for continuous integration. There may be some truth to that but, having worked as a single developer on a project, I can tell you that a good CI setup will speed your development process and help you catch platform errors sooner. While you are working on that next great feature, your build machine is checking out the latest commits on all supported platforms. It's like having an assistant that is constantly making sure your code works on all supported runtimes. What's better than that?

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.
How Do I Get Started?

As with most categories of software development tools, there are several choices available. The most widely used .NET-based CI tool is CruiseControl.NET, developed by ThoughtWorks, creators of the older and also very popular Java-based CruiseControl. For the remainder of this series, any use of the term CruiseControl or CCNet will refer to the .NET product.

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 we have the software, let's go through a basic setup. At this point you may want to give some thought to where your CI process will live. If you have a spare machine you might consider using it as a dedicated build machine. One of my farm machines, for example, runs CCNet and a mail server. If you do not have any spare physical machines, a good alternative is VMWare or Virtual PC. I run Windows Server 2003 as my host machine, but I almost always have one or two Virtual PC sessions running some variety of Windows or Linux.

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.


<project name="Example1">
<sourcecontrol type=""/>
<tasks>
..list of tasks here..
</tasks>
<publishers>
..list of publishers here..
</publishers>
</project>
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
CCNet supports several different methods of determining when to start an integration cycle. This is done using a triggers block. Three different triggers types can be specified. An interval trigger element causes an integration to begin a specified number of seconds after the last one finishes. A schedule trigger starts integration at a specified time each day. A filter trigger specifies a set of times when integration should not start, perhaps due to backup or maintenance. Here is an example of a trigger block that launches integration five minutes after the last one ends.

<project name="Example1">
   <intervalTrigger seconds="300" buildCondition="IfModificationExists"/>
</project>

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
Therefore if CCNet has to check the source code for changes, then we need to tell it what type of source control system we are using and how to access our repository. Several types of source control are supported, including CVS, SourceSafe, Subversion, StarTeam, and many others, but for this series we'll focus on Subversion. The other source control systems will function in a similar way.

To specify the source control settings, use the sourcecontrol element. Consider the following:


<sourcecontrol type="svn">
<trunkUrl>svn://svn.myhost.com/example1/trunk</trunkUrl>
<workingDirectory>c:\dev\example1</workingDirectory>
<username>myusername</username>
<password>mypass</password>
<tagOnSuccess>false</tagOnSuccess>
</sourcecontrol>
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.
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.

YOUR FEEDBACK
Ray the Barbarian wrote: I worked at Microsoft Research, and I had an in person interview with Google last year. It took three weeks after the interview to get a thumbs down. It took 4 weeks of phone interviews, email exchanges, and puzzles to work on at home before getting to that stage. They think raw brain power of people that do well at Top Coder is what they need. Writing great software at the million dollar level takes the right set of values. 1. Value Ease of Use. 2 Value Ease of Modifiable by Developers. 3. Value Low Rate of Bugs 4. Value Sustainable Work Pressure 5. Value Team Effort Google will gradually learn to value these more. Compare Software to Concrete. Concrete is visible. There are only couple of hundred different use for concrete. Concrete can only break in a few ways. It is easy to see how far along you are in a concrete project. My point, software is much harder than concrete.
Spizzy wrote: Not exactly an objective account. Hard to not be pro-microsoft if you reached the company's middle management position in just 2 years - check the man's resume on his website. Nepotism? Anyone? Wonder what a "Linux fan-boy" like myself would think about taking the route of bottom-up at MicroSoft (starting from the hard-knock developer spot).
Noah Webster wrote: I hate ur spelling and am glad you are not coming back.
bart wrote: I know people from google very well. Google does have a lot of problems and a lot of possibilities too. But when one of the quoted says MS "has better products", I start to really tune out. Very biased based on this quote alone.
gg wrote: It really surprises me that the secret the Google writes such shitty code has been a secret for so long. Just read some posts on their developers forums like this one from Google Checkout Developers Forum: http://groups.google.com/group/google-checkout-api-troubleshooting/brows... They seem to create a bunch of crap that does not work, get bored with it and then move on to produce some new crap that also does not function.
LedBetter wrote: When I interviewed with Google I found the process and approach similar. Google innovates because they are hiring the junior engineers who are still out to make a name for themselves. Plus it's easy on the bottom line when you can pay your code monkey's peanuts.
StpOnSpidr wrote: I think it's cool someone has the backbone to stand up and say that the emperor has no clothes. Good for you. I enjoyed your article very much.
Calidad wrote: I am sure that there are some Costco employees who used to work for KMart who miss their old jobs, too. From a user standpoint, if the MS employees who brought us horribly dysfunctional products and services in the past return to their old jobs, thats cool. Keep all the rats in one place, and their code is easier for me to avoid. I found this article via google news. Nuff said.
MtnGoatJoe wrote: Microsoft spent 5 YEARS on Vista, and look what they came up with. The only reason it isn't a complete failure is because people feel they are required to use Microsoft's products. I did a four month contract at Microsoft. It looks great on a resume, but the company is one HUGE bureaucratic nightmare where new ideas are only good ideas if they are cheap to implement.
Scott wrote: I think the "startup" focus is incorrect. Google is the Bazaar model in microcosm. For those who believe that the Bazaar model seen in the large as "the open source community model" can work to produce high-quality commercial software Google is a great place to work. For those who think enterprise-class software can only come from a Cathedral perhaps M$ would be a better choice.
Yakov Fain wrote: Leaving MS/Google aside, I strongly believe that badmouthing your former employer is not professional. I blogged on this over here: http://yakovfain.javadevelopersjournal.com/sergey_leaves_google_and_burn...
Dmitri Filatov wrote: I think that some of the questions that MS asked on the interview could be considered "offensive" to a senior SE, such as reversing a string or throwing coconuts. Those questions are for juniors and look silly.
Scott wrote: Well, it's wantonly obvious that Svetlin Nakov was rejected by Google. In that blog entry he just comes across as bitter and petulant toward Google, and overly impressed with himself for getting a low ball offer from MS. His account should not have even been included in this article, because I sincerely doubt he had the "choice" between the two. Otherwise I'm sure he would have jumped at the chance to mention he got an offer from Google.
Robin wrote: The bloody Blackberry ad is a pain in the butt. I am frustrated and i hate ur website wont ever come back.
MICROSOFT .NET LATEST STORIES
Xenocode announced the availability of Postbuild 2008 for .NET, a major update to its code obfuscation and deployment solution for Windows developers.Xenocode Postbuild allows software developers to deploy .NET applications in a single, secure executable that runs anywhere, with or wit...
The advent of .NET 3.5 marks a turning point in how .NET developers approach programming. "It is our belief that .NET 3.5 in general, and Silverlight in particular, will change programming more significantly than anything that has come from Microsoft for a least a decade," state bestse...
Corporate IT organizations have deployed numerous platforms over the years to enable users to collaborate on and share unstructured documents, files, and other data. File shares, document management systems, e-mail servers, Web servers – chances are that most of these are still in us...
Many of today (and tomorrow’s) development projects lend themselves nicely to RIA application patterns. Silverlight offers a compelling RIA development experience that works on Linux, the Mac and windows as well as all major browsers. With HD video, vector based graphics and a rich s...
Come see a no-slides, code-only presentation that starts with a blank directory and builds a data-driven, AJAX enabled, ASP.NET web application from scratch that implements common AJAX patterns with the rich set of AJAX Control Toolkit, accesses data with LINQ, and implements standards...
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

InstallAware Software Corporation has released InstallAware 8, a setu...