Skip to content

Instantly share code, notes, and snippets.

@diasjorge
Created January 4, 2011 16:57
Show Gist options
  • Save diasjorge/765032 to your computer and use it in GitHub Desktop.
Save diasjorge/765032 to your computer and use it in GitHub Desktop.
Avoid empty deployments
namespace :deploy do
task :check_changes do
if current_revision == real_revision
Capistrano::CLI.ui.say("You don't have any changes to deploy")
agree = Capistrano::CLI.ui.agree("Continue (Yes, [No]) ") do |q|
q.default = 'n'
end
exit unless agree
else
# current_revision depends on current_path
reset!(:current_path)
reset!(:current_revision)
reset!(:real_revision)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment