Skip to content

Instantly share code, notes, and snippets.

@basiszwo
Created March 9, 2012 14:44
Show Gist options
  • Save basiszwo/2006795 to your computer and use it in GitHub Desktop.
Save basiszwo/2006795 to your computer and use it in GitHub Desktop.
Campfire Capistrano task
#############################################################
# Campfire
#############################################################
after :deploy, 'campfire:notify'
namespace :campfire do
require 'tinder'
load File.join(File.dirname(__FILE__), 'initializers/campfire_config.rb')
desc "Send a message to the campfire chat room"
task :notify do
campfire = Tinder::Campfire.new CAMPFIRE_CONFIG[:subdomain], :token => CAMPFIRE_CONFIG[:token], :ssl => true
room = campfire.find_room_by_name CAMPFIRE_CONFIG[:deployment_room]
to_be_deployed = `git rev-parse --short "HEAD"`.chomp
room.speak "[#{domain}] #{ENV["USER"]} deployed #{to_be_deployed}@#{branch} to #{application} #{rails_env}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment