Module: IncomingWebhookNotifier

Defined in:
lib/incoming_webhook_notifier.rb,
lib/incoming_webhook_notifier/version.rb

Constant Summary collapse

VERSION =
"0.1.0"

Class Method Summary collapse

Class Method Details

.airbrake_deploy_notify(airbrake_webhook_endpoint, environment:, username:, repository:, revision:, version:) ⇒ Object



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

def self.airbrake_deploy_notify(airbrake_webhook_endpoint,
                                environment:,
                                username:,
                                repository:,
                                revision:,
                                version:)

  body_hash = {
    "environment": environment,
    "username": username,
    "repository": repository,
    "revision": revision,
    "version": version
  }

  PostHTTPS.call(airbrake_webhook_endpoint, body_hash)
end

.slack_notify(slack_webhook_endpoint, text:, pretext: nil) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/incoming_webhook_notifier.rb', line 5

def self.slack_notify(slack_webhook_endpoint, text:, pretext: nil )
  body_hash = {
    text: text,
    pretext: pretext,
    mrkdwn_in: [
      text,
      pretext
    ]
  }

  PostHTTPS.call(slack_webhook_endpoint, body_hash)
end