Skip to content

Instantly share code, notes, and snippets.

@rtomayko
Created March 1, 2010 01:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save rtomayko/317992 to your computer and use it in GitHub Desktop.
Save rtomayko/317992 to your computer and use it in GitHub Desktop.
require 'etc'
require 'campfire'
namespace :notify do
desc 'Alert Campfire of a deploy'
task :campfire do
branch_name = branch.split('/', 2).last
deployer = Etc.getlogin
deployed = `curl -s http://github.com/site/sha`[0,7]
deploying = `git rev-parse HEAD`[0,7]
compare_url = "#{source_repo_url}/compare/#{deployed}...#{deploying}"
Campfire.notify(
"#{deployer} is deploying " +
"#{branch_name} (#{deployed}..#{deploying}) to #{rails_env} " +
"with `cap #{ARGV.join(' ')}` (#{compare_url})"
)
end
end
before "deploy:update", "notify:campfire"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment