# Gemfile
gem 'capistrano-campfire'
gem 'tinder'
# config/deploy.rb
require 'capistrano/campfire'
require 'tinder'
namespace :campfire do
desc "Send a message to the campfire chat room"
task :snitch do
campfire = Tinder::Campfire.new YOUR_CAMPFIRE_ACCOUNT, :ssl => true, :token => YOUR_CAMPFIRE_TOKEN
room = campfire.find_room_by_name YOURC_CAMPFIRE_CHATROOM
snitch_message = fetch(:snitch_message) { ENV['MESSAGE'] || abort('Capfire snitch message is missing. Use set :snitch_message, "Your message"') }
room.speak(snitch_message)
end
desc "Send a message to the campfire chat room about the deploy start"
task :snitch_begin do
set :snitch_message, "BEGIN DEPLOY [#{stage.upcase}]: #{ENV['USER']}, #{branch}/#{real_revision[0, 7]} to #{deploy_to}"
snitch
end
desc "Send a message to the campfire chat room about the deploy end"
task :snitch_end do
set :snitch_message, "END DEPLOY [#{stage.upcase}]: #{ENV['USER']}, #{branch}/#{real_revision[0, 7]} to #{deploy_to}"
snitch
end
desc "Send a message to the campfire chat roob about the rollback"
task :snitch_rollback do
set :snitch_message, "ROLLBACK [#{stage.upcase}]: #{ENV['USER']}, #{latest_revision[0, 7]} to #{previous_revision[0, 7]} on #{deploy_to}"
snitch
end
end
before :deploy do
campfire.snitch_begin unless ENV['QUIET'].to_i > 0
end
after :deploy do
campfire.snitch_end unless ENV['QUIET'].to_i > 0
end
Wednesday, October 31, 2012
Added message to Campfire chatroom for Capistrano deploys
Subscribe to:
Post Comments (Atom)
Blog Archive
-
▼
2012
(42)
-
▼
October
(9)
- Added message to Campfire chatroom for Capistrano ...
- Permission denied (publickey) error when trying to...
- Top 3 hosted CI (continuous integration) for Rails...
- Update all associations of a Rails model
- Ember.js gotcha - require handlebar.js
- Scope javascript variable in coffeescript so it's ...
- Rails scaffold only the controller resource
- Customizing devise views & controllers
- Cannot customize default devise views
-
▼
October
(9)
No comments:
Post a Comment