Closed galenandrew closed 8 years ago
@galenandrew Couldn't you put everything into config/deploy.rb
and then put the following into config/deploy/development.rb
:
set :slack_run_updating, -> { false }
set :slack_run_reverting, -> { false }
set :slack_run_updated, -> { false }
set :slack_run_reverted, -> { false }
set :slack_run_failed, -> { false }
Or am I misunderstanding?
Thanks for the alternative approach @phallstrom!! That is definitely an approach that will accomplish only sending notifications for specific environments, but it still requires duplicating the same code to across multiple files "disable" the notifications.
My thought behind opening this was more of an enhancement idea vs an issue/bug. I was thinking it could be a simple whitelist for environments by setting set :slack_stages, %w(production staging)
. Maybe in addition to this it also honors the options you've listed?
I'm not a ruby developer, but would be up for taking a stab at a pull request. Any guidance or pointers on where this would make sense is appreciated.
It would be much nicer to have a slack_enabled
variable and in the correct stage file disable it.
Adding simple early return to the https://github.com/phallstrom/slackistrano/blob/78b9201f5ad59075cc27c744d52f1ea82c042878/lib/slackistrano/tasks/slack.rake#L38 should do it.
@mikz I like that. Soon.
This will soon be available as 2.0.1 on rubygems.
:+1: :star:
:metal: this solution is great!! Thanks @phallstrom and @mikz!
It would be awesome to have a variable (array) of environments that trigger slack notifications vs copying the same notification settings into each environment's deploy script.
This would allow for the notification settings to live globally in
config/deploy.rb
yet only the defined environments would trigger notifications.Example: We do a lot of deployments to
development
and don't necessarily want to clutter our slack channel with notifications from those deployments however we do want notifications for allstaging
andproduction
deployments.Setting an array variable (e.g.
:slack_environments
) would allow for a cleaner/dry-er config.