Skip to content

Instantly share code, notes, and snippets.

@pjaspers
Created March 11, 2010 23:49
Show Gist options
  • Save pjaspers/329862 to your computer and use it in GitHub Desktop.
Save pjaspers/329862 to your computer and use it in GitHub Desktop.
Notify Campfire of a deploy
require 'etc'
require 'broach'
Capistrano::Configuration.instance(:must_exist).load do
task "notify campfire" do
source_repo_url = repository
deployer = Etc.getlogin
deploying = `git rev-parse HEAD`[0,7]
begin
deployed = previous_revision[0,7]
rescue
deployed = "000000"
end
compare_url = "#{source_repo_url}/compare/#{deployed}...#{deploying}"
Broach.settings = { 'account' => 'pietj', 'token' => '06f8ccb294e0cbe916a9e57e4884ec5501ebb745' }
Broach.speak('Room 1',
"#{deployer} is deploying #{application}" +
" (#{deployed}..#{deploying}) " +
"with `cap #{ARGV.join(' ')}` (#{compare_url})"
)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment