I also asked on IRC and torrancew led me to try this

     before 'deploy:rollback',       'deploy:unlock'

     def write_deploy_lock(deploy_lock)
       put deploy_lock.to_yaml, deploy_lockfile, :mode => 0777
+      # Ensure the lockfile is remove on Interrupt
+      trap("INT") {
+        STDERR.puts 'Got shutdown signal, removing lockfile'
+        remove_deploy_lock
+      }
     end

I'm not sure how to test that, but it's what I have for now. I think my
other alternative would be to alias the capistrano handle_errors method to
add my functionality

If I add a bad github url I get
ERROR: Repository not found.
fatal: The remote end hung up unexpectedly
*** [deploy:update_code] rolling back
Command git ls-remote [email protected]:...git  master returned status code
pid 76578 exit 128

but it didn't run the unlock task

-- 
-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to [email protected]
* To unsubscribe from this group, send email to 
[email protected] For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to