Skip to content

Instantly share code, notes, and snippets.

@francois-blanchard
Created June 19, 2014 11:00
Show Gist options
  • Save francois-blanchard/7d9ec46f42c6d6193006 to your computer and use it in GitHub Desktop.
Save francois-blanchard/7d9ec46f42c6d6193006 to your computer and use it in GitHub Desktop.
Notification backup (gem) on Slack
# ~/Backup/models/production.rb
Backup::Model.new(:production, 'Descritpion') do
require 'json'
notify_by HttpPost do |post|
post.on_success = true
post.on_warning = true
post.on_failure = true
post.uri = 'https://yourname.slack.com/services/hooks/incoming-webhook'
post.params = { 'token' => 'your_token', 'payload' => { 'text' => "[Backup] Save", "channel" => "dev", "username" => "sshbot", "icon_emoji" => ":computer:" }.to_json }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment