Skip to content

Instantly share code, notes, and snippets.

@brianjlandau
Created October 21, 2011 02:33
Show Gist options
  • Select an option

  • Save brianjlandau/1302968 to your computer and use it in GitHub Desktop.

Select an option

Save brianjlandau/1302968 to your computer and use it in GitHub Desktop.
# Other deploy stuff
begin
require 'tinder'
after "deploy", "campfire"
after "deploy:migrations", "campfire"
after "deploy:rollback", "campfire"
desc '[internal] Announces deployments a Campfire room.'
task :campfire do
campfire = Tinder::Campfire.new('SUMDOMAIN', :ssl => true,
:token => 'API_KEY')
if room = campfire.find_room_by_name('ROOM_NAME')
change_message = capture("cd #{current_path}; git show --pretty=format:%s HEAD | head -n 1").strip
message = "[CAP] Just deployed \"#{change_message}\" https://github.com/ACCOUNT/REPO/commit/#{current_revision}"
if branch = fetch(:branch)
message << " from #{branch}"
end
if stage = fetch(:stage)
message << " to #{stage}"
end
room.speak "#{message}."
end
end
rescue LoadError
nil # skip campfire stuff if tinder can't be required
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment