Skip to content
This repository was archived by the owner on Jan 29, 2022. It is now read-only.

Commit bf84db7

Browse files
committed
Add app.yml options for slack channel, user, and emoji
1 parent a7fa142 commit bf84db7

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

lib/helpers/tasks.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ def notify_slack(status_message)
8787
end
8888

8989
notifier = Slack::Notifier.new settings.slack_webhook do
90-
defaults channel: '#general',
91-
username: 'puppet_webhook',
92-
icon_emoji: ':ocean:',
90+
defaults channel: settings.slack_channel,
91+
username: settings.slack_user,
92+
icon_emoji: settings.slack_emoji,
9393
http_options: http_options
9494
end
9595

lib/puppet_webhook.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ class PuppetWebhook < Sinatra::Base # rubocop:disable Style/Documentation
3838
set :use_mcollective, false unless settings.respond_to? :use_mcollective=
3939
set :discovery_timeout, false unless settings.respond_to? :discovery_timeout=
4040
set :slack_webhook, false unless settings.respond_to? :slack_webhook=
41+
set :slack_channel, '#general' unless settings.respond_to? :slack_channel=
42+
set :slack_user, 'puppet_webhook' unless settings.respond_to? :slack_user=
43+
set :slack_emoji, ':ocean:' unless settings.respond_to? :slack_emoji=
4144
set :slack_proxy_url, nil unless settings.respond_to? :slack_proxy_url=
4245
set :default_branch, 'production' unless settings.respond_to? :default_branch=
4346
set :ignore_environments, [] unless settings.respond_to? :ignore_environments=

0 commit comments

Comments
 (0)