You can hook into Slack Show archive.org snapshot when using Capistrano for deployment. The slackistrano Show archive.org snapshot gem does most of the heavy lifting for you. Its default messages are unobtrusive and can be adjusted easily.
When deploying, it posts to a Slack channel like this:
How to integrate
Integrating Slackistrano with Capistrano 3 is fairly simple.
-
In your Slack, open menu → Administration → Manage apps, and add an "Incoming WebHooks" Show archive.org snapshot integration.
-
Choose channel, and add the app.
-
Set a name and save. This will not be used for notifications, but clarifies the webhook's purpose when browsing the list of integrations.
-
Copy your "Webhook URL".
-
Add
slackistrano
to yourGemfile
, in your:deploy
group, andbundle
your project. -
Add the following to your
Capfile
.# Slack notifications require 'slackistrano/capistrano' set :slackistrano, { channel: '#your-channel', webhook: 'https://hooks.slack.com/services/your/webhook/url', }
-
Optional: Tweak your deployment messages Show archive.org snapshot . See the attached file for our default message formatting. Your
Capfile
needs to be adjusted accordingly:# Slack notifications require 'slackistrano/capistrano' require_relative 'lib/capistrano/slackistrano' set :slackistrano, { klass: Slackistrano::CustomMessaging, channel: '#your-channel', webhook: 'https://hooks.slack.com/services/your/webhook/url', }
-
Test Slackistrano:
cap staging slack:deploy:test
-
When you are satisfied, do a real deploy to confirm everything works.