Class: Honeybadger::CLI::Deploy Private

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Helpers::BackendCmd
Defined in:
lib/honeybadger/cli/deploy.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Methods included from Helpers::BackendCmd

#error_message

Constructor Details

#initialize(options, args, config) ⇒ Deploy

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Deploy.



12
13
14
15
16
17
# File 'lib/honeybadger/cli/deploy.rb', line 12

def initialize(options, args, config)
  @options = options
  @args = args
  @config = config
  @shell = ::Thor::Base.shell.new
end

Instance Method Details

#runObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/honeybadger/cli/deploy.rb', line 19

def run
  payload = {
    environment: config.get(:env),
    revision: options['revision'],
    repository: options['repository'],
    local_username: options['user']
  }

  response = config.backend.notify(:deploys, payload)
  if response.success?
    say("Deploy notification complete.", :green)
  else
    say(error_message(response), :red)
    exit(1)
  end
end