Created
June 19, 2011 11:01
-
-
Save priithaamer/1034070 to your computer and use it in GitHub Desktop.
Capistrano task to ask confirmation before deploying to production
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
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
https://gist.github.com/wacaw/657744af41dcf4963646