Created
May 27, 2010 21:24
-
-
Save iain/416380 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
# hoptoad webistrano recipe | |
# works with Rails 3 | |
after "deploy", "deploy:notify_hoptoad" | |
after "deploy:migrations", "deploy:notify_hoptoad" | |
namespace :deploy do | |
desc "Notify Hoptoad of the deployment" | |
task :notify_hoptoad do | |
rails_env = fetch(:hoptoad_env, fetch(:rails_env, "production")) | |
local_user = 'webistrano' | |
executable = RUBY_PLATFORM.downcase.include?('mswin') ? 'rake.bat' : 'rake' | |
notify_command = "cd #{current_path} && #{executable} hoptoad:deploy RAILS_ENV=production TO=#{rails_env} REVISION=#{current_revision} REPO=#{repository} USER=#{local_user}" | |
notify_command << " API_KEY=#{ENV['API_KEY']}" if ENV['API_KEY'] | |
run notify_command | |
puts "Notifying Hoptoad of Deploy (#{notify_command})" | |
puts "Hoptoad Notification Complete." | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment