Sha256: 978780e02a044e9efbd5f28117057ac8a647929d06f0f9bf71a7719b7d27dcaf
Contents?: true
Size: 1.11 KB
Versions: 58
Compression:
Stored size: 1.11 KB
Contents
namespace :ci do namespace :slack do desc 'Set up Slack' task :setup do require 'highline/import' @attachments = [] ENV['SLACK_WEBHOOK_URL'] ||= ask('Slack Webhook URL: ') ENV['SLACK_WEBHOOK_URL'] = nil if ENV['SLACK_WEBHOOK_URL'] == '' ENV['SLACK_CHANNEL'] ||= ask('Slack Channel: ') ENV['SLACK_CHANNEL'] = nil if ENV['SLACK_CHANNEL'] == '' end desc 'publish' task publish: :setup do next if @attachments.empty? || ENV['SLACK_WEBHOOK_URL'].nil? require 'ndr_dev_support/slack_message_publisher' # We have attachments so prepend them with basic commit details Rake::Task['ci:rugged:commit_details'].invoke slack_publisher = NdrDevSupport::SlackMessagePublisher.new(ENV['SLACK_WEBHOOK_URL'], username: 'Rake CI', icon_emoji: ':robot_face:', channel: ENV['SLACK_CHANNEL']) slack_publisher.post(attachments: @attachments) end end end
Version data entries
58 entries across 58 versions & 1 rubygems