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

Commit

Permalink
Add app.yml options for slack channel, user, and emoji
Browse files Browse the repository at this point in the history
  • Loading branch information
dhollinger committed Apr 24, 2018
1 parent a7fa142 commit bf84db7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/helpers/tasks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ def notify_slack(status_message)
end

notifier = Slack::Notifier.new settings.slack_webhook do
defaults channel: '#general',
username: 'puppet_webhook',
icon_emoji: ':ocean:',
defaults channel: settings.slack_channel,
username: settings.slack_user,
icon_emoji: settings.slack_emoji,
http_options: http_options
end

Expand Down
3 changes: 3 additions & 0 deletions lib/puppet_webhook.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ class PuppetWebhook < Sinatra::Base # rubocop:disable Style/Documentation
set :use_mcollective, false unless settings.respond_to? :use_mcollective=
set :discovery_timeout, false unless settings.respond_to? :discovery_timeout=
set :slack_webhook, false unless settings.respond_to? :slack_webhook=
set :slack_channel, '#general' unless settings.respond_to? :slack_channel=
set :slack_user, 'puppet_webhook' unless settings.respond_to? :slack_user=
set :slack_emoji, ':ocean:' unless settings.respond_to? :slack_emoji=
set :slack_proxy_url, nil unless settings.respond_to? :slack_proxy_url=
set :default_branch, 'production' unless settings.respond_to? :default_branch=
set :ignore_environments, [] unless settings.respond_to? :ignore_environments=
Expand Down

0 comments on commit bf84db7

Please sign in to comment.