Class: KapostDeploy::Plugins::SlackAfterPromote

Inherits:
Object
  • Object
show all
Defined in:
lib/kapost_deploy/plugins/slack_after_promote.rb

Overview

After-promotion plugin to notify via slack after a promotion is complete with an optional message.

Instance Method Summary collapse

Constructor Details

#initialize(config, notifier: KapostDeploy::Slack::Notifier.new(config.options.fetch(:slack_config, nil))) ⇒ SlackAfterPromote

Returns a new instance of SlackAfterPromote.



10
11
12
13
14
# File 'lib/kapost_deploy/plugins/slack_after_promote.rb', line 10

def initialize(config,
               notifier: KapostDeploy::Slack::Notifier.new(config.options.fetch(:slack_config, nil)))
  self.config = config
  self.notifier = notifier
end

Instance Method Details

#afterObject



19
20
21
22
23
24
# File 'lib/kapost_deploy/plugins/slack_after_promote.rb', line 19

def after
  return unless notifier.configured?

  message = "#{identity} promoted *#{config.app}* to *#{config.to}*#{additional_message}"
  notifier.notify(message)
end

#beforeObject



16
17
# File 'lib/kapost_deploy/plugins/slack_after_promote.rb', line 16

def before
end