Closed grappler closed 7 years ago
What does the slackistrano settings look like in your config/deploy.rb?
Like this
set :slackistrano, {
channel: '#deploy',
webhook: 'https://hooks.slack.com/services/'
}
@grappler You need to make your own custom messaging class and tweak the payload.
See https://github.com/phallstrom/slackistrano#customizing-the-messaging
Using a class like this:
module Slackistrano
class CustomMessaging < Messaging::Base
def payload_for_updated
make_message(super.merge(color: 'good'))
end
def payload_for_reverted
make_message(super.merge(color: 'warning'))
end
def payload_for_failed
make_message(super.merge(color: 'danger'))
end
private ##################################################
def make_message(options={})
attachment = options.reject{|k, v| v.nil? }
{attachments: [attachment]}
end
end
end
Thank you for your help! I not well versed in ruby so struggled how I could adapt the example.
I was able to get it to a point where we have created our own gem with this included. https://rubygems.org/gems/capistrano-wearerequired
I am using slackistrano (3.1.0) with the webhook. When we were using version (2.0.1) there was always a colour for the notifications.
How can I get that back?