Class: Airbrake::DeployNotifier

Inherits:
Object
  • Object
show all
Includes:
Inspectable
Defined in:
lib/airbrake-ruby/deploy_notifier.rb

Overview

DeployNotifier sends deploy information to Airbrake. The information consists of:

  • environment

  • username

  • repository

  • revision

  • version

Since:

  • v3.2.0

Constant Summary

Constants included from Inspectable

Inspectable::INSPECT_TEMPLATE

Instance Method Summary collapse

Methods included from Inspectable

#inspect, #pretty_print

Constructor Details

#initializeDeployNotifier

Returns a new instance of DeployNotifier.

Since:

  • v3.2.0



15
16
17
18
# File 'lib/airbrake-ruby/deploy_notifier.rb', line 15

def initialize
  @config = Airbrake::Config.instance
  @sender = SyncSender.new
end

Instance Method Details

#notify(deploy_info) ⇒ Object

See Also:

Since:

  • v3.2.0



21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/airbrake-ruby/deploy_notifier.rb', line 21

def notify(deploy_info)
  promise = @config.check_configuration
  return promise if promise.rejected?

  promise = Airbrake::Promise.new
  deploy_info[:environment] ||= @config.environment
  @sender.send(
    deploy_info,
    promise,
    URI.join(@config.error_host, "api/v4/projects/#{@config.project_id}/deploys"),
  )

  promise
end