Campystrano: Campfire integration for your Capistrano deploy tasks

Communicating with your peers is an important part of engineering. We make a lot of posts to Campfire: questions, jokes, CI build results, git commits, pull request notifications, New Relic performance alerts, robot voice control for company announcements, local milkshake suggestions, and… deploy announcements. To make that last one a bit easier, we built a gem integrating Campfire into our Capistrano deploy tasks. Campystrano adds two deploy hooks. The first hook (triggered before the start of the Capistrano :deploy task) announces the start of the deploy including the deployer’s name, deployment branch, and the Rails environment. It might look something like this:

chris deploying master to MyApp production

The second is a post-deploy hook that announces a successful deploy.

Deploy to MyApp production finished successully

We’re in the middle of breaking apart our main Rails app into smaller, more manageable apps. While there are a great many benefits to this, it does create some overhead for our deploy pipeline. Instead of deploying to just one app, we’re now deploying to four and counting. Campystrano has helped us quickly add consistent deploy notifications to all of our apps.

Usage

Add the following to your Gemfile:

1
gem 'campystrano'

In your config/deploy.rb file, add the following:

1
2
3
4
5
6
7
8
9
require 'capistrano/campystrano'

set :campfire_settings do
  {
    subdomain: mysubdomain,
    room: myroom,
    token: ENV['CAMPFIRE_TOKEN']
  }
end

And deploy away!