Created
October 8, 2009 14:18
-
-
Save tobias/205055 to your computer and use it in GitHub Desktop.
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
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