Created
June 6, 2014 08:29
-
-
Save jcleary/9d26da4f017f0225d75b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# --------------------------------------------------------------------------- | |
# Pushover for Capistrano 3.1 | |
# Sends a pushover notification after deployment or rollback | |
# | |
# Instructions: | |
# - Save this file into lib/capistrano/tasks/notify.rb | |
# - Add this to your Gemfile | |
# gem 'rushover' | |
# - in this file or deploy.rb add these two lines (get this info from pushover.net) | |
# set :pushover_app_token, 'xxx' | |
# set :pushover_user_key, 'yyy' | |
# - include this file in your Capfile. You can do it by adding this line | |
# require_relative 'lib/capistrano/tasks/notify' | |
# | |
# --------------------------------------------------------------------------- | |
require 'rushover' | |
namespace :notify do | |
task :pushover do | |
client = Rushover::Client.new(fetch(:pushover_app_token)) | |
client.notify( | |
fetch(:pushover_user_key), | |
"User #{ENV['USER']} deployed branch #{fetch(:branch)} to #{fetch(:stage)}", | |
:priority => 0, | |
:title => 'Deployment complete!' | |
) | |
end | |
end | |
after 'deploy:finishing', 'notify:pushover' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment