Sunday, September 24, 2006

Continuous integration for Ruby

It's really not that scary.I just started work on a Rails project, and I was setting up my development environment. Source control? That's easy, Subversion. IDE? Well, there are some promising projects like the intelliJ plugin and the jEdit plugin, but I finally settled on Eclipse with the RDT plugin. Database? Oracle 10g. Continuous Integration? ... Ahem, Continuous Integration!?! ... Unfortunately the Ruby continuous integration field looks pretty weak. Damage control looked promising, but active development is stopped, their source repository is down, and from what I gather the development team broke most of the functionality before they gave up on it. The rest of the solutions I found by googling involved rolling your own, shell scripts and cron, or using cruiseControl to trigger things, but cruise doesn't support rake. Finally, after copius googling I found a link to Cerberus. The Cerberus page lists Anatol Pomozov as the only admin on the project, so I assume he is the creator. The aim is to "guard your tests and not allow your project to go to the world of dead." I got this from the README file which contains a description of what Cerberus means.

What I like about Cerberus is that it is very simple to use. To install it you just do 'gem install cerberus'. Once installed you run the command 'cerberus add' followed by the repository URL, the name of the app, and a list of people who should get the emails. Finally you can run 'cerberus buildall' and Cerberus will run some rake tasks to build and test your project. It is very simple! Since cerberus isn't a persistent server it relies on cron for the automation, but for me that is just fine. There are some yml configuration files, but they are very minimal. You should have no problems figuring it out. I would have liked some more documentation because I bet there are some features not covered in the README, but overall I can't complain. I had continuous integration up and running in minutes. If you are looking for CI in Ruby, you should give Cerberus a shot. I think the ease of use will win it many fans in the future.

Wednesday, September 20, 2006

Subversion build labels in CruiseControl


I spent some time last week learning about setting up CruiseControl. My motivation was to figure out how to make the subversion revision number part of our build number. Example: say we are on build number 101, cruise kicks off and does a checkout. The code gets updated to revision 1001. That means the build number becomes 101.1001. This mapping from build to revision is useful. Say you had delivered build 85 to the customer, and there is a bug. In order to look at the code in production you need to update your working copy to the production build. If you don't have the revision in the build number you have to go rummaging through logs to find which revision build 85 is, or you can checkout the branch that cruise creates for each build, but for large codebases, that is time consuming. With the build-revision style label you can quickly update to that revision.

Making this happen should be easy, right? Just write a build labelIncrementer plugin that gets the SVN revision. The catch is that in cruise control build numbers are calculated ahead of time. I had made an unfortunate assumption that the build label was calculated at build time and so I wrote an entire plugin to calculate the label I wanted. Then I realized it would never work. Of course this behaviour is documented, but I wasn't bright enough to read that ahead of time. Here is the code to my SVN LabelIncrementer. You can use it but you might be disappointed when your revision numbers in the label are from a previous build. Or you can just skip ahead and read how I ended up satisfying my requirement without writing a plugin.

Monday, September 11, 2006

The ultimate blog post

Me and my big mouthThis is a quote from a totally awesome Wired editorial
"Blog" itself is short for "weblog," which is short for "we blog because we weren't very popular in high school and we're trying to gain respect and admiration without actually having to be around people."
Along with a really creative short explanation for the origins of the blog, this article has satirized the style of blogging on many of the most popular weblogs. In the realm of blogs, where hubris and grammatical errors are numbers 2 and 1 respectively on the list of things you always see, this was a refreshing read.

Sunday, September 10, 2006

Linux taking over the desktop?

Will tux make his Superbowl debut?World Domination!
I saw this quote on slashdot.
A Harvard Study which uses formal economic modelling to determine "Will OSS ever displace traditional software from its market leadership position?" came to a (not so?) surprising result. Linux is likely to remain second best as long as Microsoft has a first mover advantage.
Did anyone at Harvard consider the fact that Linux isn't trying to compete with Microsoft? When was the last time you walked down the street and glanced up to see the word "Linux" on a billboard in letters 20 feet tall? The last time you saw Tux the penguin in a Super-Bowl halftime commercial? Never, because the people who create Linux aren't trying to sell you anything. I predict that Linux will continue to quietly out-do Windows for years to come, and I'm looking forward to never spending any money on it. Hooray for free software!

Thursday, September 7, 2006

Tile Toy is for real!

Tiletoy, for real this time
indexing a list, traversing it twice...A while back I wrote an entry on Tiletoy, an open project for building some mini networking toys with a sort of retro-chic look. The site had claimed that they were going to release everything under some form of open license so that people could build their own Tiletoys, but the date for releasing that came and went without any news. Today I googled for Tiletoy and look what popped up! Totally awesome! Too bad the site is a flash site. Annoying. I don't see what they need flash for. Anyway, this is great news, and even after reading their discouraging checklist I am undaunted. (I can't link to specific pages of their site because their site is flash trash and does some lame url rewriting, so I reproduce it here)

The Lawrence Connection

lawrence!!The last couple Chirb meetings have been interesting. Somewhat interesting is the Rails focus, but mostly just meeting people from the community. I met Adrian Holovaty at the August meeting. He gave a supplimentary talk to Jake Scruggs' excellent presentation on Streamlined. As the main guy behind Django (a Python framework) his impromptu was an effective Streamlined bodyslam followed by a Ruby/Rails piledriver. (Something about Python made me think of Hulk Hogan who called his biceps Pythons, hence the wrestling speak). The September meeting was even more Railsy because it was given by Marcel Molina a Ruby on Rails committer and a member of 37 Signals.

Talking with Adrian was fun because he used to live in Lawrence, Kansas, and so did I. In fact, the Django framework was developed there. Talking with Marcel was also interesting, and the conversation veered strangely to Lawrence. He seemed to know alot about the town, the university there, and the fact that Django was developed there. I suppose there is no real connection between him and Lawrence, but I'm interested to see who will pop up for the next Chirb meeting. It is turning out to be a real Lawrence party.