Created
April 17, 2012 18:07
-
-
Save quard8/2407891 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
require "rubygems" | |
require "xmpp4r" | |
require 'xmpp4r/client' | |
require 'xmpp4r/muc' | |
jabber_user = "user@jabber.ru" | |
jabber_password = "password" | |
jabber_conference = "conf@conference.jabber.ru" | |
jabber_nick = "user" | |
client = Jabber::Client::new(Jabber::JID::new(jabber_user)) | |
client.connect | |
client.auth(jabber_password) | |
client.send(Jabber::Presence::new.set_type(:available)) | |
bot = Jabber::MUC::SimpleMUCClient.new(client) | |
bot.join(Jabber::JID.new(jabber_conference + "/" + nick)) | |
set :local_user, ENV['USER'] || ENV['USERNAME'] || 'unknown' | |
namespace :say do | |
task :start do | |
info = "#{local_user} started deploing #{application} to #{stage} with branch #{branch}" | |
bot.say(info) | |
end | |
task :end do | |
info = "#{local_user} deployed #{application} to #{stage} with branch #{branch}. Result: OK" | |
bot.say(info) | |
end | |
task :failure do | |
info = "#{local_user} deployed #{application} to #{stage} with branch #{branch}. Result: ERROR" | |
end | |
end | |
before "deploy", "say:start" | |
after "deploy:finalize_update", "say:end" | |
after :rollback, "say:failure" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment