Sha256: a7e9d3ba4cac1b08b6c119faced169ab25e08904cdef2acb344cc1e0b5b08ae8

Contents?: true

Size: 933 Bytes

Versions: 53

Compression:

Stored size: 933 Bytes

Contents

require 'appsignal/integrations/capistrano/careful_logger'

module Appsignal
  class Marker
    include Appsignal::CarefulLogger

    attr_reader :marker_data, :config, :logger
    ACTION = 'markers'

    def initialize(marker_data, config, logger)
      @marker_data = marker_data
      @config = config
      @logger = logger
    end

    def transmit
      begin
        transmitter = Transmitter.new(ACTION, config)
        logger.info("Notifying Appsignal of deploy with: revision: #{marker_data[:revision]}, user: #{marker_data[:user]}")
        result = transmitter.transmit(marker_data)
        if result == '200'
          logger.info('Appsignal has been notified of this deploy!')
        else
          raise "#{result} at #{transmitter.uri}"
        end
      rescue Exception => e
        carefully_log_error(
          "Something went wrong while trying to notify Appsignal: #{e}"
        )
      end
    end
  end
end

Version data entries

53 entries across 53 versions & 1 rubygems

Version Path
appsignal-0.11.18 lib/appsignal/marker.rb
appsignal-0.11.17 lib/appsignal/marker.rb
appsignal-0.11.16 lib/appsignal/marker.rb
appsignal-0.11.15 lib/appsignal/marker.rb
appsignal-0.11.14 lib/appsignal/marker.rb
appsignal-0.11.14.beta.1 lib/appsignal/marker.rb
appsignal-0.11.13 lib/appsignal/marker.rb
appsignal-0.11.13.beta.4 lib/appsignal/marker.rb
appsignal-0.11.13.beta.3 lib/appsignal/marker.rb
appsignal-0.11.13.beta.2 lib/appsignal/marker.rb
appsignal-0.11.13.beta.1 lib/appsignal/marker.rb
appsignal-0.11.13.beta.0 lib/appsignal/marker.rb
appsignal-0.11.12 lib/appsignal/marker.rb
appsignal-0.11.11 lib/appsignal/marker.rb
appsignal-0.11.10 lib/appsignal/marker.rb
appsignal-0.11.10.beta.2 lib/appsignal/marker.rb
appsignal-0.11.10.beta.1 lib/appsignal/marker.rb
appsignal-0.11.9 lib/appsignal/marker.rb
appsignal-0.11.8.beta.4 lib/appsignal/marker.rb
appsignal-0.11.8.beta.3 lib/appsignal/marker.rb