Last active
August 29, 2015 14:15
-
-
Save microspino/1f7553d6cd7614410ab7 to your computer and use it in GitHub Desktop.
safe deploy from master to live
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
task :ask_confirmation do | |
on roles(:all) do | |
run_locally do | |
puts "##########################################################".red | |
puts "# Are you sure you want do deploy #{fetch :branch} to #{fetch :stage}".red | |
puts "##########################################################".red | |
if fetch(:stage) == "live" && fetch(:branch) != "master" | |
abort "Mcfly? Anybody home? you can deploy live only from master" | |
end | |
ask :confirmation, "N" | |
if fetch(:confirmation).downcase != "y" | |
raise "Deploy aborted" | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment