After a long arduous battle (gross exaggeration) fighting for Capistrano we are finally implementing it at my company. Of course we have found that Capistrano doesn’t always work the way we would like it to. Luckily Capistrano seems pretty easily extendable.
Today I created caplock, a ruby gem to prevent Capistrano from preforming simultaneous deployments. This is the basic workflow:
Before a deployment:
1. abort if the lock file exists on the remote server (this means another deployment is already in progress)
2. create a lock file on remote server
After a deployment:
1. remove the lock file