Jeff Cleath

Technology Management

Continuous Integration with CruiseControl.NET, NANT, and the Ambient Orb

After learning about the concept of continuous integration, I became interested in building a continuous integration environment that could not only build and deploy our projects, but could also connect to some type of visual indicator for project status.    The following are the tasks we completed.

Create a Build Environment

We looked at a few options to automate our builds and decided to first try out CruiseControl.NET.   CruiseControl.NET provide a pretty good platform to control the builds of projects based on schedule or code changes as well as a web site to view build information and force builds.   While implementing the build process, we found that Cruise Control alone didn't provide all of the functionality required to build and deploy applications.  This led us to add NANT into the process.  NANT provides a much more flexible platform to perform the actual tasks of building and deploying the application, leaving Cruise Control to do the scheduling and reporting.  NANT is also used to  run our NUnit and FxCop tasks, as well as deploy the files to a QA server and execute the SQL scripts to apply the database changes to the QA database server.

Integrating the Ambient Orb

Once the build environment was up and running I decided to look for a devide to use as an indicator for build status.  From a google search, I found a blog by Michael Swanson that talked about using the Ambient Orb for with a continuous integration environment.  It seemed like great idea.   After doing some research on the Orb, I wasn't very keen on the idea of paying Anbient to control the orb color by using their custom calls but instead decided to buy the availble serial interface for the Orb and develop something myself to control the color of the orb.

From there, the following are the steps I completed to get my Orb to display the status of our builds ( a general status since I didn't want to get an Orb per project).

1) I created an assembly that performed like a controller/driver to the orb, allowing me to make simple calls to the orb to change the orb colors in a number of ways.  It allowed me to pass serial port number, red/blue/green color indicators, color by name or enum and other methods to easily control the orb display.

2) Since I didn't want to have the Orb connected to the build server, I then created a web service that could be called remotely on the machine connected to the Orb.  This web service allowed me to call it giving the port, color, red/green/blue levels to control the orb. 

3) Next, in trying to have NANT control the color of the Orb, I found it was easier to call a web page to pass the red/green color to indicate a successful or failed build than to call the web service.  Therefore, I added aweb page as part of the web service project to control the color from after the build was completed.

4) Finally, in an attempt to use my single orb to indicate the general health of our builds consisting of a number of projects I decided to develop a windows service on the Orb machine that would look at each post from the build server, and keep track of the last build status for each project.   If any of the builds last build failed, the orb would be red, if all builds last build was successful, then the orb would remain green.

What Next? 

I am looking into other devices that could be used not only to display build information in a more detailed format, but possibly integrate other information such as tests passed/failed, code coverage, or other possible project information.  If anybody has other suggestions it would be great to hear them.

I am also working on integrating MSBuild and Microsoft Unit Testing for Visual Studio 2005 into our build process.

 

 

Leave a Comment

(required) 

(required) 

(optional)

(required)