Created
January 15, 2009 15:42
-
-
Save tomlea/47448 to your computer and use it in GitHub Desktop.
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 :deployment do | |
desc "Mark the deployment as locked, preventing further deployments (until deployment:unlock)" | |
task :lock, :roles => :app do | |
run "touch -f #{shared_path}/locked" | |
end | |
desc "Unmark the deployment as locked, allowing further deployments (until deployment:lock)" | |
task :unlock, :roles => :app do | |
run "rm #{shared_path}/locked" | |
end | |
task :abort_if_locked do | |
run "if [ -f #{shared_path}/locked ]; then echo '***** THE PROJECT HAS BEEN LOCKED *****'; false; fi" | |
end | |
end | |
before "deploy" do | |
deployment.abort_if_locked | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment