Updated unified sample.env and setup default values to some variables

This commit is contained in:
jfederico
2017-08-14 20:26:43 +00:00
parent 582ab30eb0
commit ea5c78db47
6 changed files with 140 additions and 171 deletions

View File

@ -23,14 +23,15 @@ rescue URI::InvalidURIError
false
end
if !ENV['SLACK_WEBHOOK'].nil? && !ENV['SLACK_WEBHOOK'].empty? && uri?(ENV['SLACK_WEBHOOK']) then
# Initialize the slack notifier.
Rails.application.config.slack_notifier = Slack::Notifier.new ENV['SLACK_WEBHOOK'] do
defaults channel: ENV['SLACK_CHANNEL'],
username: "BigBlueButton",
icon_url: 'https://avatars3.githubusercontent.com/u/230228?v=3&s=200'
end
else
if !ENV['SLACK_WEBHOOK'] || !ENV['SLACK_CHANNEL'] || !uri?(ENV['SLACK_WEBHOOK']) then
# Initialize it to nil (slack not configured)
Rails.application.config.slack_notifier = nil
return
end
# Initialize the slack notifier.
Rails.application.config.slack_notifier = Slack::Notifier.new ENV['SLACK_WEBHOOK'] do
defaults channel: ENV['SLACK_CHANNEL'],
username: "BigBlueButton",
icon_url: 'https://avatars3.githubusercontent.com/u/230228?v=3&s=200'
end