lib/slackistrano/tasks/slack.rake in slackistrano-0.1.4 vs lib/slackistrano/tasks/slack.rake in slackistrano-0.1.5
- old
+ new
@@ -13,11 +13,13 @@
payload: {
channel: fetch(:slack_channel),
username: fetch(:slack_username),
icon_url: fetch(:slack_icon_url),
icon_emoji: fetch(:slack_icon_emoji),
- text: fetch(:slack_msg_starting)
+ attachments: [{
+ text: fetch(:slack_msg_starting)
+ }]
}
)
end
end
end
@@ -33,11 +35,14 @@
payload: {
channel: fetch(:slack_channel),
username: fetch(:slack_username),
icon_url: fetch(:slack_icon_url),
icon_emoji: fetch(:slack_icon_emoji),
- text: fetch(:slack_msg_finished)
+ attachments: [{
+ color: 'good',
+ text: fetch(:slack_msg_finished)
+ }]
}
)
end
end
end
@@ -53,11 +58,14 @@
payload: {
channel: fetch(:slack_channel),
username: fetch(:slack_username),
icon_url: fetch(:slack_icon_url),
icon_emoji: fetch(:slack_icon_emoji),
- text: fetch(:slack_msg_failed),
+ attachments: [{
+ color: 'danger',
+ text: fetch(:slack_msg_failed)
+ }]
}
)
end
end
end
@@ -82,10 +90,10 @@
set :slack_icon_emoji, ->{ nil } # Emoji to use. Overrides icon_url. Must be a string (ex: ':shipit:')
set :slack_username, ->{ 'Slackistrano' }
set :slack_run_starting, ->{ true } # Set to false to disable starting message.
set :slack_run_finished, ->{ true } # Set to false to disable finished message.
set :slack_run_failed, ->{ true } # Set to false to disable failure message.
- set :slack_msg_starting, ->{ "#{ENV['USER'] || ENV['USERNAME']} has started deploying branch #{fetch :branch} of #{fetch :application} to #{fetch :stage, 'an unknown stage'}." }
- set :slack_msg_finished, ->{ "#{ENV['USER'] || ENV['USERNAME']} has finished deploying branch #{fetch :branch} of #{fetch :application} to #{fetch :stage, 'an unknown stage'}." }
- set :slack_msg_failed, ->{ "*ERROR!* #{ENV['USER'] || ENV['USERNAME']} failed to deploy branch #{fetch :branch} of #{fetch :application} to #{fetch :stage, 'an unknown stage'}." }
+ set :slack_msg_starting, ->{ "#{ENV['USER'] || ENV['USERNAME']} has started deploying branch #{fetch :branch} of #{fetch :application} to #{fetch :stage, 'an unknown stage'}" }
+ set :slack_msg_finished, ->{ "#{ENV['USER'] || ENV['USERNAME']} has finished deploying branch #{fetch :branch} of #{fetch :application} to #{fetch :stage, 'an unknown stage'}" }
+ set :slack_msg_failed, ->{ "#{ENV['USER'] || ENV['USERNAME']} failed to deploy branch #{fetch :branch} of #{fetch :application} to #{fetch :stage, 'an unknown stage'}" }
end
end