Created
March 31, 2014 16:01
-
-
Save tarmotalu/9895655 to your computer and use it in GitHub Desktop.
Capistrano 3 deploy confirmation
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
namespace :deploy do | |
task :confirmation 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 | |
ask :value, "Are you sure you want to continue? (Y)" | |
if fetch(:value) != 'Y' | |
puts "\nDeploy cancelled!" | |
exit | |
end | |
end | |
end | |
Capistrano::DSL.stages.each do |stage| | |
after stage, 'deploy:confirmation' if stage == 'production' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment