Class: CircleciDeploymentNotifier::Slack

Inherits:
Object
  • Object
show all
Defined in:
lib/circleci_deployment_notifier/slack.rb

Overview

Sends notifications to Slack. Builds the message using a BuildInfo object.

Instance Method Summary collapse

Constructor Details

#initialize(webhook_url:, app_name:, build_info:) ⇒ Slack

Returns a new instance of Slack.

Parameters:

  • webhook_url (String)

    Slack Webhook URL

  • app_name (String)

    Name of the application that was deployed.

  • build_info (BuildInfo)


12
13
14
15
16
# File 'lib/circleci_deployment_notifier/slack.rb', line 12

def initialize(webhook_url:, app_name:, build_info:)
  self.webhook_url = webhook_url
  self.app_name = app_name
  self.build_info = build_info
end

Instance Method Details

#sendObject

Sends the message to Slack.



19
20
21
# File 'lib/circleci_deployment_notifier/slack.rb', line 19

def send
  slack_notifier.post message
end