Capistrano Deployment for Omeka

28 Aug 2009 . . Comments

#ruby #capistrano

We’re currently starting a project at the Scholars’ Lab in which we’re going to use Omeka. We’re a Rails shop and use Capistrano to deploy projects to our staging and production servers all the time. Since I had read that Capistrano didn’t need to be for Rails, I thought it would help out in deploying the PHP for our Omeka work.

It took a little work, but I finally stumbled across Lee Hambley’s railsless-deploy project over on Github.

The install is pretty easy (assuming you have rubygems installed).

$ gem sources -a http://gems.github.com/ # make sure you have github sources installed
$ gem install leehambley-railsless-deploy

After this, for rails apps, you just capify the project, but this command didn’t seem to work, so I just manually added the Capfile in the root of the project directory with the snip provided on the project page:

load 'deploy' if respond_to?(:namespace) # cap2 differentiator
# Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }

require 'rubygems'
require 'railsless-deploy'
load    'config/deploy'

After that, it was just a matter of using the recipes we typically use. Now, after we get the plugins we’re developing ready to be deployed, all we have to do is

$ cap deploy

Capistrano makes life so much easier!