Skip to content

Instantly share code, notes, and snippets.

@marianposaceanu
Forked from priithaamer/gist:1034070
Created June 25, 2014 15:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marianposaceanu/1e269401306e28232d03 to your computer and use it in GitHub Desktop.
Save marianposaceanu/1e269401306e28232d03 to your computer and use it in GitHub Desktop.
task :ask_production_confirmation do
set(:confirmed) do
puts <<-WARN
========================================================================
WARNING: You're about to perform actions on production server(s)
Please confirm that all your intentions are kind and friendly
========================================================================
WARN
answer = Capistrano::CLI.ui.ask " Are you sure you want to continue? (Y) "
if answer == 'Y' then true else false end
end
unless fetch(:confirmed)
puts "\nDeploy cancelled!"
exit
end
end
before 'production', :ask_production_confirmation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment