Skip to content

Instantly share code, notes, and snippets.

@tobias
Created October 8, 2009 14:18
Show Gist options
  • Save tobias/205055 to your computer and use it in GitHub Desktop.
Save tobias/205055 to your computer and use it in GitHub Desktop.
after "deploy", "deploy:notify_campfire"
after "deploy:migrations", "deploy:notify_campfire"
namespace :deploy do
desc 'notifies campfire room of deploy'
task :notify_campfire do
begin
require 'tinder'
rails_env = fetch(:rails_env, "production")
local_user = ENV['USER'] || ENV['USERNAME']
msg = "[#{application}/#{branch}] deployed to #{rails_env} by #{local_user} at #{Time.now}"
puts "Notifying Campfire with '#{msg}'"
#assuming your campfire url is my-campfire.campfirenow.com
campfire = Tinder::Campfire.new('my-campfire')
campfire.login('[email protected]', 'bot-password')
room = campfire.find_room_by_name('A Campfire Room')
room.speak(msg)
campfire.logout
rescue
#don't kill cap just because we can't notify
puts "Notifying Campfire failed: #{$!}"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment