Inspired by Engine Yard's eycap (github.com/engineyard/eycap), fdlcap is a set of extracted cap tasks, configurations, and callbacks from various Factory Design Labs projects.

It's designed to ease some common scenarios for deploying reasonably complex apps to Engine Yard environments. It's also designed to make it easier to package up deployment logic and make it reusable.

Some of the recipes include:

  • auto_tagger - provide a default set of stages and set up deploy callbacks for progressive deployment with auto_tagger (github.com/zilkey/auto_tagger))

  • craken - set up deploy callbacks for deploying raketab files to cron with craken

  • delayed_job - start/stop/restart delayed_job workers with monit and set up deploy callbacks for restarting workers

  • geminstaller - set up deploy callbacks for running chad woolley's geminstaller

  • newrelic - set up deploy callbacks for notifying newrelic of deployments

  • rake - run arbitrary rake tasks, commands, and ruby snippets on remote servers from a single command

  • rsync - pull assets from production servers to development

  • sass - set up deploy callbacks for updating sass stylesheets on deploy to avoid caching issues

  • slice - tail arbitrary server logs and show custom maintenance pages

  • ssh - shortcut to execute ssh sessions and tunnels to remote servers

  • thinking_sphinx - set up deploy callbacks for thinking sphinx

  • stages - enable capistrano-ext/multistage

  • database - recipies for pulling production mysql databases locally, also can push to remote db

  • thin - manage a thin deployment

  • nginx - control nginx as well as generate configurations

One kind of cool addition is a simple mechanism for bundling callbacks, configuration variables, and tasks into reusable recipe chunks that can easily be dropped into your deploy configuration.

For example, to automatically set up tasks and callbacks for stages, delayed_job and sass, you would add the following to deploy.rb:

use_recipe :delayed_job
use_recipe :sass
use_recipe :stages, :staging, :production

You can also create your own recipe chunks with the define_recipe method:

define_recipe :my_recipe do
  # tasks, config, whatever go here

Then include them in your deploy.rb:

use_recipe :my_recipe

Recipes can also take arguments (such as in the stages recipe)

define_recipe :stages do |*stages|
  set :stages, stages.flatten unless exists?(:stages) && !stages.empty?
  require 'capistrano/ext/multistage'


Aside from capistrano, fdlcap depends on the following gems:

These should all be installed automatically by rubygems when you install fdlcap.

For development, make sure you have bundler installed (github.com/wycats/bundler)

$ gem install bundler
$ git clone git://github.com/factorylabs/fdlcap.git
$ cd fdlcap
$ gem bundle
$ ./gbin/rake


sudo gem install fdlcap --source http://gemcutter.org

You may want to add the gem to your config.gems or geminstaller config as well.

You'll also need to add the following line to your deploy.rb:

require 'fdlcap/recipes'


Copyright © 2009 Gabe Varela and Jay Zeschin. See LICENSE for details.