docbrown/app/lib/release_phase_notifier.rb

15 lines
483 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['FAILED_COMMAND']}")
rescue Slack::Notifier::APIError => e
Honeybadger.notify(e)
end
end