phallstrom / slackistrano

Slack integration for Capistrano deployments.
MIT License
374 stars 74 forks source link

How can I get a list of all servers #76

Closed ilijamt closed 6 years ago

ilijamt commented 7 years ago

Is it possible to get a list of all the servers I'm deploying too, so my message will show to which servers I'm also deploying.

screenshot from 2017-09-06 18-08-54

PiTrem commented 7 years ago

you could define some helper method in your custom_messaging.rb

      def server_hostnames
        roles(:web).map do |host|
          "#{host.user}@#{host.hostname}"
        end.join(', ')
      end

      def payload_for_updating
        {
          text: "on server #{server_hostnames} " + super[:text]
        }
      end