Sha256: c0714042f6a00ed74ee01f4fc597ff5787a7d2f0c23c359b91927c9dd1a2775a

Contents?: true

Size: 588 Bytes

Versions: 27

Compression:

Stored size: 588 Bytes

Contents

module Vidar
  class SentryNotification
    def initialize(revision:, deploy_config:)
      @revision = revision
      @webhook_url = deploy_config.sentry_webhook_url
      @connection = Faraday.new
    end

    def configured?
      !webhook_url.to_s.empty?
    end

    def call
      connection.post do |req|
        req.url webhook_url
        req.headers['Content-Type'] = 'application/json'
        req.body = data.to_json
      end
    end

    private

    attr_reader :connection, :revision, :webhook_url

    def data
      {
        version: revision
      }
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
vidar-1.13.4 lib/vidar/sentry_notification.rb
vidar-1.13.3 lib/vidar/sentry_notification.rb
vidar-1.13.2 lib/vidar/sentry_notification.rb
vidar-1.13.1 lib/vidar/sentry_notification.rb
vidar-1.13.0 lib/vidar/sentry_notification.rb
vidar-1.13.0.rc1 lib/vidar/sentry_notification.rb
vidar-1.12.1 lib/vidar/sentry_notification.rb
vidar-1.12.0 lib/vidar/sentry_notification.rb
vidar-1.11.0 lib/vidar/sentry_notification.rb
vidar-1.10.0 lib/vidar/sentry_notification.rb
vidar-1.9.4 lib/vidar/sentry_notification.rb
vidar-1.9.3 lib/vidar/sentry_notification.rb
vidar-1.9.2 lib/vidar/sentry_notification.rb
vidar-1.9.1 lib/vidar/sentry_notification.rb
vidar-1.9.0 lib/vidar/sentry_notification.rb
vidar-1.8.0 lib/vidar/sentry_notification.rb
vidar-1.8.0.rc4 lib/vidar/sentry_notification.rb
vidar-1.7.0 lib/vidar/sentry_notification.rb
vidar-1.6.0 lib/vidar/sentry_notification.rb
vidar-1.5.4 lib/vidar/sentry_notification.rb