Wednesday, 20 February 2008

Using Monit to manage your app servers in Capistrano 2

If you've gone to the trouble of setting up monit on your server (or you're using a Brightbox like I am), why not let it take the strain of starting and stopping your app servers during a Capistrano deployment.

Just stick this code snippet at the bottom of the deploy.rb file.


# Redefine the application server controls to use monit.

namespace :deploy do
%W(start stop restart).each do |event|
desc "#{event} using Monit"
task event, :except => { :no_release => true } do
sudo "/usr/sbin/monit -g #{application} #{event} all"
end
end
end

Monday, 4 February 2008

The Rails Way - if you haven't got it, get it.

I've been working through The Rails Way by Obie Fernandez and it is most definitely the best reference text for Rails I've come across so far. It's in depth, informative and even opinionated in places.

It covers Rails 2.0 but I found that throughout the text there were strange omissions - no mention of Sexy Migrations for example even though they've been there for nine months now. Having said that keeping up with a fast moving target like Rails can't be easy when you have a hungry publisher breathing down your neck.

Anyway if you're a Rails developer you need this book.