No commit activity in last 3 years
No release in over 3 years
Configurable deploy hooks for Capistrano
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.12
~> 5.0
~> 10.0

Runtime

>= 3.3.0
 Project Readme

Capistrano::DeployHooks

This is a small framework for generating webhooks for the various stages of a Capistrano deploy. It comes with some messengers prepacked, for example Mattermost.

Installation

Add this line to your application's Gemfile:

gem 'capistrano-deploy_hooks'

And then execute:

$ bundle

Usage

In your Capfile:

require 'capistrano/deploy_hooks'

In your Capistrano config:

# or another messenger from somewhere
require 'capistrano/deploy_hooks/messengers/mattermost'

if ENV['WEBHOOK_URI']
  set :deploy_hooks, {
    messenger: Capistrano::DeployHooks::Messengers::Mattermost,
    webhook_uri: ENV['WEBHOOK_URI'],
  }
end

Messengers

Messengers should respond to payload_for(action), and return Hash 'payloads', with the following optional actions: updating, reverting, updated, reverted, failed. They should also respond to webhook_for(action) and return a URI to post the webhook to. See capistrano/deploy_hooks/messengers/mattermost.rb as an example of this. Messengers are initialized with the hash config passed to capistrano's set :deploy_hooks call.

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake test to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/capistrano-mattermost.