Topic: How do I use transactions within custom capistrano tasks?
(Originally posted on stackoverflow with no replies)
I've been through the documentation and thought I'd figured out how to do it, but it's not working for me.
Here's what I have:
When I run cap staging deploy:bundle and set it up to fail, I get the following output:
triggering start callbacks for `staging' * executing `staging' triggering start callbacks for `deploy:bundle' * executing `multistage:ensure' * executing `deploy:bundle' ** transaction: start * executing "cd /path/to/app/current; RAILS_ROOT=/path/to/app/current rake bundle:js" servers: ["example.com"] [example.com] executing command *** [err :: example.com] rake aborted! *** [err :: example.com] invalid byte sequence in US-ASCII # Trace here - removed for brevity command finished failed: "sh -c 'cd /path/to/app/current; RAILS_ROOT=/path/to/app/current rake bundle:js'" on example.com
So it is in a transaction, but my on_rollback hook doesn't get run. It does seem to know the task failed, as it outputs failed at the end - even though I haven't raised an exception.
Any ideas as to why my on_rollback isn't running?