Skip to content

Instantly share code, notes, and snippets.

@tomlea
Created January 15, 2009 15:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomlea/47448 to your computer and use it in GitHub Desktop.
Save tomlea/47448 to your computer and use it in GitHub Desktop.
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