Created
November 6, 2014 16:45
Add a confirmation to capistrano deploys
This file contains hidden or 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
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