Project

envoy

0.0
No commit activity in last 3 years
No release in over 3 years
A simple, extendable messaging system built for deployments
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

= 1.3.0
~> 2.1.0
~> 0.3.5

Runtime

= 0.2.1
= 1.2.7.1
 Project Readme

A simple, extendable messaging system designed for deployments

Usage

gem install envoy (use sudo if not using RVM)
require 'envoy'

Create a new messenger

messenger = Envoy::Messenger.new

Define some transports

messenger.transports.each do |transport|
  transport.add_transport(:campfire, :account => 'foo', :token => 'bar', :room => 'my_room')
end

OR

messenger.transport(:campfire, :account => 'foo', :token => 'bar', :room => 'my_room')

Add some messages

messenger.messages.each do |message|
  message.add_message(:name => 'Start deployment message', :subject => "Carlos started deployment of branch foo to production at #{Time.now}")
  message.add_message(:name => 'End deployment message', :subject => "Carlos ended deployment of branch foo to production at #{Time.now}")
end

OR

messenger.message(:name => 'Start deployment message', :subject => "Carlos started deployment of branch foo to production at #{Time.now}")

Deliver messages one at a time

messenger.deliver_start_deployment_message

AND THEN

messenger.deliver_end_deployment_message

Deliver all messages

messenger.deliver_all_messages

Email, Campfire, and Webhook Transports are included. Create your own by inheriting from Envoy::Transport

Sample Capistrano Usage

begin
  require 'envoy'
  set :envoy_loaded, true
rescue LoadError
  set :envoy_loaded, false
end

if envoy_loaded
  set :messenger, Envoy::Messenger.new
  set :git_username, `git config user.name`.gsub("\n", '')
  messenger.transport :name => :campfire, :account => [YOUR ACCOUNT HERE], :token => [YOUR TOKEN HERE], :use_ssl => true
else
  set :messenger, nil
end

before :deploy do
  if messenger
    messenger.message :name => :start_deployment,
      :subject => "#{git_username} started deployment of branch master to production for project Foo at #{Time.now}"
    messenger.deliver_start_deployment
  end
end

after :deploy do
  if messenger
    messenger.message :name => :end_deployment,
      :subject => "#{git_username} ended deployment of branch master to production for project Foo at #{Time.now}"
    messenger.deliver_end_deployment
  end
end

Thanks

Thanks to Robby Russell for beta testing

Copyright

Envoy is Copyright (c) 2010 Carlos Rodriguez, released under the MIT License.