Skip to content

Instantly share code, notes, and snippets.

@BrettBukowski
Created November 6, 2014 16:45
Show Gist options
  • Save BrettBukowski/3a0a54eed0e4df3c54d5 to your computer and use it in GitHub Desktop.
Save BrettBukowski/3a0a54eed0e4df3c54d5 to your computer and use it in GitHub Desktop.
Add a confirmation to capistrano deploys
set :confirm_keys, lambda {
puts "This is the config file that will be uploaded and used in production:"
puts IO.read('config/deploy/production-secrets.json')
ask :answer, "Continue deploying with these config settings? [Y/N]"
fetch(:answer).downcase.strip == 'y'
}
namespace :deploy do
desc "Confirms if the config file should be uploaded"
task :prompt do
unless fetch(:confirm_keys)
puts "Deploy cancelled\n"
exit
end
end
end
before :started, "deploy:prompt"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment