Sha256: 62f29fde9b5ea4001a0d124c079527105e6b0161c2ad2dc502b49cc914c3105f

Contents?: true

Size: 922 Bytes

Versions: 6

Compression:

Stored size: 922 Bytes

Contents

require 'forwardable'
require 'honeybadger/cli/main'
require 'honeybadger/util/http'

module Honeybadger
  module CLI
    class Deploy
      extend Forwardable

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

      def run
        payload = {
          environment: options['environment'],
          revision: options['revision'],
          repository: options['repository'],
          local_username: options['user']
        }

        result = config.backend.notify(:deploys, payload)
        if result.success?
          say("Deploy notification complete.", :green)
        else
          say("Invalid response from server: #{result.code}", :red)
          exit(1)
        end
      end

      private

      attr_reader :options, :args, :config

      def_delegator :@shell, :say
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
honeybadger-3.0.2 lib/honeybadger/cli/deploy.rb
honeybadger-3.0.1 lib/honeybadger/cli/deploy.rb
honeybadger-3.0.0 lib/honeybadger/cli/deploy.rb
honeybadger-3.0.0.beta6 lib/honeybadger/cli/deploy.rb
honeybadger-3.0.0.beta5 lib/honeybadger/cli/deploy.rb
honeybadger-3.0.0.beta4 lib/honeybadger/cli/deploy.rb