Skip to content

Instantly share code, notes, and snippets.

@iain
Created May 27, 2010 21:24
Show Gist options
  • Save iain/416380 to your computer and use it in GitHub Desktop.
Save iain/416380 to your computer and use it in GitHub Desktop.
# 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