Skip to content

Instantly share code, notes, and snippets.

@jwulff
Last active December 11, 2015 03:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jwulff/4541182 to your computer and use it in GitHub Desktop.
Save jwulff/4541182 to your computer and use it in GitHub Desktop.
Deploy notifications in Campfire that include GitHub compare view of what was deployed.
# In deploy.rb
require 'capistrano/campfire'
set :campfire_options, :account => 'orcasnet',
:room => 'Ops',
:token => 'XXX',
:ssl => true
after 'deploy', 'campfire:success'
after 'deploy:cold', 'campfire:success'
namespace :campfire do
task :success do
message = "#{ENV['USER'].capitalize} deployed #{application}."
if previous_revision == current_revision
message << "\n\tCode Changes: none"
else
message << "\n\tCode Changes: https://github.com/orcasnet/#{application}/compare/#{previous_revision[0..7]}...#{current_revision[0..7]}"
end
message << "\n\tBranch: https://github.com/orcasnet/#{application}/tree/#{branch}"
message << "\n\tDeploy Command: cap #{ARGV.join ' '}"
campfire_room.paste message
end
end
# Makes a message like this in Campfire after a successful deploy
# John deployed docstore.
# Code Changes: https://github.com/orcasnet/docstore/compare/427ed826...a2436b6a
# Branch: https://github.com/orcasnet/docstore/tree/master
# Deploy Command: cap deploy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment