Instant Continuous Integration via the cloud

how-to
Sep 28, 20093 mins

Looking to get Continuous Integration running for your project in short order? I recently took a look at CI in a Box, which is a

cloud based solution that provides Hudson, as a CI server, Java 6, Ant and Maven 2

for a test spin and let me assure you — it’s practically instant, baby! What’s more, the hip cats behind the service have a tutorial that made things quite easy. In fact, I was able to get two open source projects up and running with CI in minutes! Here’s what I did:

ci in a box
First, I logged into my Amazon AWS account and went to the AWS Management Console, clicked the AMIs link and searched for the image ami-d07494b9.

Once I found it, I then right clicked on the instance name and selected the Launch Instance option, which, as you can imagine, launched the instance. Once I did this, I had to wait a few moments (the first time you launch an AMI it takes a minute or two to fire it up, baby).

The CI in a Box image has Tomcat running (with Hudson set as the root context); thus, via the AWS Management Console, you can obtain the public DNS name and accordingly, copy it into your browser’s location box. It might take a second to resolve, but once it does, you should see the Hudson home page in your browser — now you’re ready to configure a CI project!

I figured I’d start easy, so I configured CI in a Box to monitor Fuse Metrics, which is a simple build tool that

ci in a box

analyzes your metrics data, and produces a single page view of whichever metrics you find interesting, including trending graphs and some histographic analysis of your entire code base.

Fuse Metrics uses Ant as a build platform, so within a minute or so, I was able to configure Hudson to monitor the Google code SVN repository and build an artifact anytime there is a change — in this case, the artifact is the resulting jar file from the build process.

Next, I thought I’d try something a bit more challenging — that is, I wanted to see if I could easily configure CI in a Box to build a non-Ant or Maven project; consequently, I decided easyb would be a good test as easyb is built using Gant.

First, I ssh‘ed onto my CI in a Box instance and downloaded the most current version of Gant via wget like so:

$>wget <a href="https://dist.codehaus.org/gant/distributions/gant-1.7.0.tgz">https://dist.codehaus.org/gant/distributions/gant-1.7.0.tgz</a>

Then I unpacked it:

$>tar xvf gant-1.7.0.tgz

ci in a box
Next, I went to the Hudson home page via my browser and proceeded to configure another project; however, in this case, when it came to the Build section, I selected the Execute shell option (FYI, there is a Gant plug-in but recent testing seemed to indicate it is broken or doesn’t work properly with the current version of Gant) and wrote two simple commands to invoke Gant directly on the easyb code base.

Needless to say, baby, things worked wonderfully and in a matter of minutes, I had CI working for easyb!

If you’re looking to spin up a CI process for your project then look no further man — CI in a Box works, well, out of the box, baby!

Looking to spin up Continuous Integration quickly? Check out www.ciinabox.com.
andrew_glover

When Andrew Glover isn't listening to “Funkytown” or “Le Freak” he enjoys speaking on the No Fluff Just Stuff Tour. He also writes articles for multiple online publications including IBM's developerWorks and O'Reilly’s ONJava and ONLamp portals. Andrew is also the co-author of Java Testing Patterns, which was published by Wiley in September 2004; Addison-Wesley’s Continuous Integration; and Manning’s Groovy in Action.

More from this author