Skip to content

Instantly share code, notes, and snippets.

@tarmotalu
Created March 31, 2014 16:01
Show Gist options
  • Save tarmotalu/9895655 to your computer and use it in GitHub Desktop.
Save tarmotalu/9895655 to your computer and use it in GitHub Desktop.
Capistrano 3 deploy confirmation
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