Last active
December 11, 2015 03:58
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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