Announce Mina deployments to a slack channel.
Add this line to your application's Gemfile:
gem 'mina-slack', github: "eManPrague/mina-slack"
And then execute:
$ bundle
Include the recipe in your deploy.rb
# config/deploy.rb
require 'mina/slack'
You'll need to setup your slack details with an API key, room and subdomain. You can add these as ENV variables or in the config/deploy.rb
# required
set :slack_hook, 'https://hooks.slack.com/services/<YOUR-STRING1>/<YOUR-STRING2>/<YOUR-STRING3>' # comes from inbound webhook integration
# optional
set :slack_username, 'Deploy Bot' # displayed as name of message sender
set :slack_emoji, ':cloud:' # will be used as the avatar for the message
set :slack_stage, 'staging' # will be used to specify the deployment environment
Or use the ENV variables:
# required
ENV['SLACK_HOOK'] = ''
# optional
ENV['SLACK_USERNAME'] = ''
ENV['SLACK_EMOJI'] = ''
ENV['SLACK_STAGE'] = '' # or ENV['to']
Update deploy
task to invoke slack:post_info
task:
task :deploy do
invoke :'slack:post_info'
end
- Fork it ( http://github.com//mina-slack/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request