Sha256: 75b105bdfa32f3dd536bac9c766c7a2dc4f5a2e19dd417a5d969a924ba1d71e1

Contents?: true

Size: 590 Bytes

Versions: 26

Compression:

Stored size: 590 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

26 entries across 26 versions & 1 rubygems

Version Path
vidar-1.4.0 lib/vidar/sentry_notification.rb
vidar-1.3.2 lib/vidar/sentry_notification.rb
vidar-1.3.1 lib/vidar/sentry_notification.rb
vidar-1.3.0 lib/vidar/sentry_notification.rb
vidar-1.2.0 lib/vidar/sentry_notification.rb
vidar-1.1.5 lib/vidar/sentry_notification.rb
vidar-1.1.4 lib/vidar/sentry_notification.rb
vidar-1.1.3 lib/vidar/sentry_notification.rb
vidar-1.1.2 lib/vidar/sentry_notification.rb
vidar-1.1.1 lib/vidar/sentry_notification.rb
vidar-1.1.0 lib/vidar/sentry_notification.rb
vidar-1.0.0 lib/vidar/sentry_notification.rb
vidar-0.13.1 lib/vidar/sentry_notification.rb
vidar-0.13.0 lib/vidar/sentry_notification.rb
vidar-0.12.1 lib/vidar/sentry_notification.rb
vidar-0.12.0 lib/vidar/sentry_notification.rb
vidar-0.11.0 lib/vidar/sentry_notification.rb
vidar-0.10.2 lib/vidar/sentry_notification.rb
vidar-0.10.1 lib/vidar/sentry_notification.rb
vidar-0.10.0 lib/vidar/sentry_notification.rb