docbrown/app/lib/release_phase_notifier.rb
Mac Siri 678dda8cf4
Routine Rubopcop lint fixes (#17844)
* Routine Rubopcop lint fixes

* Undo app_secrets_spec changes

* Fix broken spec
2022-06-07 10:17:16 -04:00

15 lines
494 B
Ruby

class ReleasePhaseNotifier
def self.ping_slack
return unless ApplicationConfig["SLACK_WEBHOOK_URL"].present? && ApplicationConfig["SLACK_DEPLOY_CHANNEL"].present?
client = Slack::Notifier.new(
ApplicationConfig["SLACK_WEBHOOK_URL"],
channel: ApplicationConfig["SLACK_DEPLOY_CHANNEL"],
username: "Heroku",
)
client.ping("Release Phase Failed: #{ENV.fetch('FAILED_COMMAND', nil)}")
rescue Slack::Notifier::APIError => e
Honeybadger.notify(e)
end
end