Archive for February, 2007

CruiseControl.rb - Continuous Integration, the Ruby way

Once again, Ruby is revealing itself as a delivery tool. This time in the form of CruiseControl.rb - ruby continuous integration tool/application.

CruiseControl.rb was the topic for this month’s Calgary Ruby Users Group (CRUSERS) meeting. Accorindg to core-contributor Alexey Verkhovsky, from Thoughworks (Calgary), it’s an ‘incarnation’ [A carefully chosen word, over 'port'] of Cruise Control (the famous continuous integration tool in Java).

The session was a light-hearted one, probably matching the spirit that lead to CruiseControl.rb.

  • Java Cruise Control:
    • History.
    • Shortcomings (setup, Ruby integration).
    • Other “Basic’ CI tools (Cerberus, CIA or continuous Builder Plugin by DHH).
  • CruiseControl.rb features:
    • Lightweight.
    • Easy Setup (No DB setup even).
    • Email, CCTray, Jabber (plug-in), RSS notifications.
    • Plugin architecture (for the lava lamp enthusiasts).
    • Configurations (if needed), are in Ruby.
  • Setup:
    • Extract the compressed file
      • Dashboard Rails application (for monitoring).
      • Scripts (cruise) for adding/removing project, starting/stopping the daemon (builder) script.
    • Add a project (cruise add <project_name> –url file:///path/to/svn/repo/project)
    • Start the Dashboard rails application.
    • Enjoy.
  • How it works:
    • The builder (deamon) script polls the SVN repo for change.
      When change is found; CruiseControl.rb updates a copy of the project, then invokes the project Rake file tasks. The priority is a ‘cruise’ task, db:test:purge, db:migrate, test or then the ‘default’ task (check cc_build.rake)
  • Custom Configurations:
    • Custom configurations can be done through cruise_config.rb in your project directory.
    • Example:
      Project.configure do|project|
      project.scheduler.polling_interval = 10
      end
  • CruiseControl shortcomings (opinionated features?)
    • SVN only (so far)
    • Can’t detect build results ran from outside the Dashboard (ran from the console).
    • Ruby projects only (but theoretically can be hooked to other projets).
    • SVN externals not handled.
  • Coming Soon:
    • Dependency builds
  • How to contribute:
    • TRY IT OUT!
    • Propose features/bugs/patches/… you know.
  • Cool things to try:
    • You have access (from the dashboard) to the failure/error-causing line (hyperlinked tothe file, with the line highlighted)
    • Text/HTML files placed in CC-BUILD_ARTIFACTS are picked up by CruiseControl.rb and hyperlinked on the specific project dashboard page (check: http://cruisecontrolrb.thoughtworks.com/builds/CruiseControl right side links for test coverage /rcov files)
  • Some ‘hidden’ links:

Quite a nice and light tool that definitely has a market (at least I know I am going to use it).

Dang: Alex was the lucky one winning ‘Rails Cookbook’ ruffle - and yes - he knows Rails enough to pass it to a friend :)

In the News

Couple of quick thoughts:

A man sentenced to death in Kuwait for the 1983 bombings of the U.S. and French embassies now sits in Iraq’s parliament, according to U.S. military intelligence — via cnn

Does it take a “Military Intelligence” to say that a man who’s ‘publicly’ a member of the Iraqi parliament is actually ‘publicly’ convicted in Kuwait? What do these guys use a source of intelligence? The Internet?

On another note:

Former Soviet leader Mikhail Gorbachev on Monday asked Microsoft co-founder Bill Gates to intercede on behalf of a Russian teacher accused of using pirated software in his classroom ….[and] is threatened with detention in Siberian prison camps - via cnn

There’s no question that Mr. Gates should intervene (I think he would). The question is HOW? Should he show it to the world? Should he write an open letter back? Should he open a private school, with labs equipped with Vista, and hire the teacher as a principle?

What do you think?

Ruby on Rails - Lunch and Learn

Last Friday was my Ruby on Rails presentation at Commerx Corporation (in Lunch and Learn series). It wasn’t as good as I wanted, but, wasn’t too bad either. Some keys on the laptop were in the on-again-off-again mode, so, I had to rely on an external keyboard and use the touchpad at the same time (not a very recommended setup).

Anyways, I think some of the guys were entrigued enough to, at least, give it a try. Being mainly at a PHP shop, I’m still not qualified to do a full comparison, but, from the little time I spent with PHP (so far), I’m becoming even more attached to the beloved Rails.

I think I’m becoming more of a Rails fanatic - comparing every code and architecture I come across to Rails. I find myself asking, how ‘that’ could be done in Rails. How could ruby shine in such a situation. How elegant would it be to implement that in Rails. How much less lines of code I could reach that same setup.

My next project is a minor refactoring of what seems like a complex Java project (read: reusable components). I’m still exploring the source tree. I can’t help but to wonder about the size of the project, and what it ‘actually’ do :). I’m having a hard time forcing myself ‘NOT’ to think of it as a Rails rewrite opportunity. Hope I can manage :)

First hockey game

Yesterday I attended my first ever ice-hockey game (Hitmen vs Kootenay), courtesy of Robert Kulhawy, Commerx Corporation, or simply my boss. Dave was so kind in accompanying me to the game.

The game was a thrill in many ways, especially when experiencing, first-hand, how the sport is loved and cheered by many. I’m planning to take some lessons in skating, perhaps I can join the NHL.

It was really surprised when I saw my name on the arena-screen (or whatever it’s called). Dave is the man when it comes to nice gestures.

The game ended 3-1 (Go Hitmen!) so, I was glad my first game was a win for the local team.

100_2940.JPG

Look closer… It says “Welcome, Tamer from Egypt attending his first hockey game”.