Introduction to Cruisecontrolrb – An RoR Integration Server

What is Cruisecontrolrb Cruisecontrol.rb is a simple and popular rails continuous integration server. Like continuous integration tools, its basic functionality is to build the source code of a project whenever a new commit is made to the main repository. Cruisecontrolrb setup Setting up cruisecontrol.rb for your app is very simple. You need to download it from and setup onto your server as a simple rails application. After the cruisecontrol is setup, you need to add your project to it using the following console command:-
./cruise add  -u
You can alternatively add your project from UI as well by running the cuisecontrol application and by going to Add Project menu. Running Cruisecontrolrb After configuring your project, you can continue running it as rails app on port no 3000 or for a continuous monitoring you can start it on port 3333 by running the following command:-
./cruise start
Now whenever any of the developer checks in something to the main repository, it will monitor the activity and start building the project by fetching the code from that main repository. Configuring Cruisecontrolrb Cruisecontrolrb provides a lot of configuration options to the developers. Along with the inbuilt options there are a plenty of opensource plugins available to use with cruisecontrolrb. An example configuration to notify the developers regarding build failed and build fixed, you can mention configure their email addresses in the ~/.cruise/site_config file on your server as following(supposing sendmail/smtp is already configured on server) :-
<em>project.email_notifier.emails = ['', '']
You can checkout more configuration options here. If you want to manually build the project, you can open UI on port 3333 and press the build now button. Already go to command line and type the following:-
./cruise build
Additional functionality and Plugins Cruisecontrolrb provides a plethora of flexibility to build additional functionality and plugins. There are several complex and basic callbacks exposed to developers to achieve the functionality required including but not limited to:- polling_source_control no_new_revisions_detected new_revisions_detected build_requested queued timed_out build_initiated configuration_modified build_started build_finished build_broken build_fixed build_loop_failed sleeping Apart from that, its very easy to write a plugin in cruisecontrol.rb. All you need to do is just to create a simple file with the following format:-
class SamplePlugin < BuilderPlugin
		  def build_finished(build)
		    //you custom code
		    //goes here
		Project.plugin :sample_plugin
and save it in .cuise/builder_plugins folder. Enjoy the continuous  integration on your latest RoR app !!