Note: This documentation is for the as yet to be released version 2.0.0 of Capistrano::Grove. I expect this to be ready for release in the next few days.
Send deployment notifications to your grove.io channel via Capistrano. Never again will members of your team not be made aware of events during your deployment. Alert them to maintenance page changes, migrations and deployment events by using this gem.
Add this line to your application's Gemfile:
gem "capistrano-grove", "~> 2.0.0pre1"
And then execute:
Or install it yourself as:
$ gem install capistrano-grove --pre
Capistrano::Grove is built on Capnotify which provides a series of built-in notifications. This gem plugs into those notifications and sends them to your grove.io channel.
Once you've gone through the above installation procedure, all you need to do is set
grove_channel_token as a Capistrano variable as follows:
set :grove_channel_token, 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
With that, you'll start receiving notifications to your channel for migrations, deployment and maintenance page changes.
In addition to the above, you can configure how your messages appear:
set :grove_service_name, 'MyDeployer' set :grove_icon_url, 'https://grove.io/static/img/webapp-logo.png' set :grove_url, 'http://example.com'
Because Capistrano::Grove is built on Capnotify, you should refer to that documentation for further customizing the messages that are posted to your channel:
You can also use the
grove.notify function anywhere in your Capistrano recipes to post
messages to your channel ad-hoc. For example:
grove.notify 'Greetings from Capistrano!'
Notes for those upgrading from 1.x
For users coming from the 1.x gem, 2.0 brings some changes that will break your existing recipes. Keep the following in mind and adjust accordingly:
grove_channel_keycapistrano variable is now called
grove_channel_token. This was done to better jive with the grove.io documentation.
- there is no longer a
grove:notifytask. This was replaced by the
grovecapistrano extension and added a
notifyfunction to it which takes a message as a parameter. (for example:
grove.notify "hi there")
grove_messagecapistrano variable has been removed. Previously, this was used to store the message to be posted to your grove.io channel after a deployment, but with the implementation of Capnotify, it's unnecessary.
The following are Capistrano variables and are used via the
The channel token from the grove.io website. This is the only variable that is required to get Capistrano::Grove working.
The name of the service, aka the handle of the user, that the notification comes from. This defaults to 'Deploybot'
This should not contain spaces as that causes the grove.io webservice some grief.
This should be a URL to an image that the service will use as its avatar in the channel.
When clicking your notification in the grove.io notification window, this is the URL that you're taken to.
Capistrano::Grove comes with a single function:
grove.notify for posting messages
to your channel. It takes a single parameter-the message to post.
grove.notify "That was easy!"
©2012-2013 Spike Grobstein
MIT License (see
LICENSE file included in this package).