Monday, May 11, 2009

Deploying rails applications with vlad

Vlad is application deployment automation tool much like Capistrano but with much less complexity and it integrates right into rake. so no need to capify your project again. Vlad is based on standard nix tools like ssh and rsync .

To make it even better is that it comes with built in support for number of version control systems like Darcs, Subversion, Mercurial and best of all Git. To get started you need to install vlad gem on your machine and on each of servers you wish to deploy your ruby app.

sudo gem install vlad


The variables for deployment are typically setup in config/deploy.rb file just like capistrano. For trival one server deployment all you have to do is set four vaiables in deploy.rb file


set :application, "myblog"
set :domain, "blog.com"
set :deploy_to, "/var/rails/myblog"
set :repository", "http://svn.myserver.com/myblog/trunk"


Also add following lines to Rakefile as well to require vlad gem


Begin
require 'vlad'
Vlad.load
rescue LoadError
#do nothing
end


Just run following commands in this sequence to deploy your application


vlad:setup #run first time only
vlad:update
vlad:migrate #optional
vlad:start


As you might be aware Capistrano is not going to be maintained anymore by Jamis buck and there is lot of active development going on for vlad it should be good idea to give vlad a spin as alternative to capistrano.

DHH speaks of 5 years of ruby on rails and rails 3

DHH's keynote on Railsconf 2009 speaks about five years of ruby on rails. Rails 3 and secret of high productivity.