0.09
No commit activity in last 3 years
No release in over 3 years
There's a lot of open issues
Announce capistrano deploys to slack
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 1.0.9
~> 1.8.0
>= 2.5.0
>= 0

Runtime

 Project Readme

Capistrano Slack

Install

Best way to install Capistrano Slack intergration is via Bundler.

Add the following to your Gemfile, then run the bundle command to install the gem direct from the git repository

gem 'capistrano-slack', :git => 'https://github.com/j-mcnally/capistrano-slack.git'

Once installed you can use the settings below in your Capistrano deploy.rb to configure Slack.

Push deployment messages to Slack

#in deploy/shared.rb add
require 'capistrano/slack'

#in deploy.rb 
# required
set :slack_token, "webhook_token" # comes from inbound webhook integration
set :slack_room, "#general"
set :slack_subdomain, "kohactive" # if your subdomain is kohactive.slack.com


before 'deploy', 'slack:starting'
after 'deploy',  'slack:finished'


# optional
set :slack_application, "Rocketman"
set :slack_username, "Elton John"
set :slack_emoji, ":rocket:"
set :slack_deploy_defaults, false #gem provides the standard before and after callbacks deploy:starting and deploy:finished deploy of set to false and provide your own. 
#example slack:starting and slack:finished are the only defaults provided in the gem. 

You can obtain your webhook_token from the integrations section of the team page in Slack.

https://kohactive.slack.com/services/new/incoming-webhook (if your subdomain is kohactive.slack.com)

Add custom messages to callbacks

namespace :slack do
    namespace :migration do 
        task :start do 
            @migration_start_time = Time.now
            msg = "Running Migrations"
            slack_connect(msg)
        end
        task :end do 
            elapsed_time = Time.now.to_i - @migration_start_time.to_i   if @migration_start_time
            msg = "Migrations finished in #{elapsed_time} seconds"
            slack_connect(msg)
        end
    end
    before "deploy:migrate", "slack:migration:start"
    after  "deploy:migrate", "slack:migration:end"