This tutorial shows how to install, configure and run Cruise-monitor for monitoring builds.
Install
Cruise-monitor uses gem for loading libraries, and rake for for running tests. They should be installed with MacOs, otherwise please install them first. We're currently using these versions:
- gem 1.3.5
- rake 0.8.7
First step is downloading Sources; we'll refer to the folder you have downloaded sources into as $CRUISE-MONITOR-HOME (e.g. /Users/me/cruise-monitor). Open a terminal and move to $CRUISE-MONITOR-HOME:
cd $CRUISE-MONITOR-HOME
Then, install required gems. Cruise-monitor uses httpclient for HTTP and nokogiri for parsing RSS:
sudo gem install httpclient nokogiri
All tests can now be run with:
rake
You should see unit, integration and acceptance tests pass.
Configure
Cruise-monitor is shipped with a sample script, cruise_monitor.rb.example. So, first copy it to cruise_monitor.rb:
cp script/cruise_monitor.rb.example script/cruise_monitor.rb
In order to run it, set the script executable, with:
chmod +x ./script/cruise_monitor.rb
We can now configure it. Open script/cruise_monitor.rb and set CRUISE_URL to project's build RSS feed.
Now, let's set a monitor on cruise feed. By default, "enthusiastic" mode is on, so all new builds are monitored. This is set with:
monitor = Monitor.all_builds_on(..)
If you want to be notified about failures only, use:
monitor = Monitor.failures_on(..)
Run
Try to run it:
./script/cruise_monitor.rb
You should hear you MacOs saying something about configured project's latest build.
Finally, you can schedule a cron job every few minutes. Set schedule interval in order to have a complete build done! E.g. if the buil takes 3 minutes, schedule cron every 5 minutes, and the like. So, type:
crontab -e
and add this line:
*/5 * * * * /$CRUISE-MONITOR-HOME/script/cruise_monitor.rb
That's all!