Tuesday, September 9, 2014

Continuous integration with Cruise Control

Utilized for continuous/custom defined integration and delivery of source code and present in many agile environments, Cruise Control is an excellent tool your team can use to increase productivity.

We have personally configured and managed Cruise Control in Unix based environments to perform automatic nightly builds, per check-in builds, per change set / feature set builds and even hourly builds. However Cruise Control has a .NET version as well suitable for Windows environments.

We have used Cruise Control for data driven, we based projects of all sorts but most of them were related to management software for security devices, e-commerce, front ends of intense transaction databases etc. Actually you can use Cruise Control to automate the builds of virtually any kind of project you may have.

The concept is simple: you basically provision a build server, install the Cruise Control package and you configure it in conjunction with your Source Control System to pull sources and build them based on customized triggers and conditions you as a developer define.

Once the code is built, there are built-in mechanisms for automatic deployment of artifacts as well (i.e. such as straight forward mechanisms to deploy on dev, qa and uat targets).

For this article I will use the original documentation on cruisecontrol.sourceforge.net

Architectural overview

Here is a link to an architectural overview of Cruise Control:

http://cruisecontrol.sourceforge.net/overview.html

The build loop

The build loop is the core of the automatic build process. It runs in background as a Unix daemon and it periodically checks the sources repository for changes in the code line. The time frames / events that trigger the new builds are highly configurable using the config.xml file.

Here are more details about the build loop of Cruise Control:

http://cruisecontrol.sourceforge.net/main/index.html

Config.xml

In config.xml you define things like what is your source control system (svn, cvs, perforce etc.), what do you use to build your code (i.e. ant), where do you pull sources for different projects, when do you pull sources for different projects (i.e. nightly, every hour, per check-in etc.), where do you publish the artifacts, where do you keep your logs, what plug-ins you are using etc.

Here are more details about your config.xml file:

http://cruisecontrol.sourceforge.net/main/configxml.html

Build results console

Build results JSP provides the results (or the output) of the build loop providing status on the built projects including current and previous projects.

Here are more details on the build results console:

http://cruisecontrol.sourceforge.net/reporting/jsp/index.html

Dashboard

The Dashboard is an important web based tool that allows for visual representations of different projects statuses. There are square icons with different color codes to get instant visual status of your projects: i.e. build successful, build failed, build queued, build paused etc.

Here are more details about your Cruise Control Dashboard, it's an awesome tool:

http://cruisecontrol.sourceforge.net/dashboard.html

In conclusion Cruise Control is an easy to use and configure builds automation and delivery tool that works in conjunction with all the major source control systems, build tools, reporting tools and defect tracking systems and that presents a variety of options to control and trigger the build.

I personally learned Cruise Control in less than a week and I used it successfully for years.

Make it a great day!

Adrian Corbuleanu
Miami Beach, FL
http://wittywebnow.com