Class: KapostDeploy::Plugins::NotifyDatadogAfterPromote

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

Overview

Notify Datadog (via seismograph) about deployments by:

- sending deployment timing
- logging an info event

Instance Method Summary collapse

Constructor Details

#initialize(config, notifier: KapostDeploy::Seismograph::Notifier.new, ahead_releases: KapostDeploy::Heroku::AppReleases.new(config.app, token: config.heroku_api_token)) ⇒ NotifyDatadogAfterPromote



12
13
14
15
16
17
18
# File 'lib/kapost_deploy/plugins/notify_datadog_after_promote.rb', line 12

def initialize(config,
               notifier: KapostDeploy::Seismograph::Notifier.new,
               ahead_releases: KapostDeploy::Heroku::AppReleases.new(config.app, token: config.heroku_api_token))
  self.config = config
  self.notifier = notifier
  self.ahead_releases = ahead_releases
end

Instance Method Details

#afterObject



24
25
26
27
28
# File 'lib/kapost_deploy/plugins/notify_datadog_after_promote.rb', line 24

def after
  return unless start_time

  notify_datadog
end

#beforeObject



20
21
22
# File 'lib/kapost_deploy/plugins/notify_datadog_after_promote.rb', line 20

def before
  @start_time = Time.now
end