Late night capistrano
Excerpt from my current Capistrano cheat sheet:
cap deploy_with_migrations - will deploy normally and then run 'rake db:migrate' (SCARY!) - 'cap disable_web' (FIRST!) - WILL NOT RUN ANY :after_deploy methods (FUCK!)
Now don’t get me wrong, I really love Capistrano (now at 1.4) as it makes my development life a lot easier. It’s just those little bits that bite you in the ass in the most unexpected moment.
Oh, and I’m sure there’s a reasonable explanation for this behaviour.
UPDATE: It has its own ticket now.

February 21st, 2007 at 7:22 am
i don’t think there’s a default after_deploy task even with the normal `cap deploy`. after_update_code sure, but after_deploy? after_migrate? those doesn’t exist out of the box. you can use after_update_code to do some more extra tasks after deploying, but what do you need to do after migration anyway?
February 21st, 2007 at 11:16 am
Evan: there is no default “after_deploy” task. There is, however, a default “after_deploy” hook. You use it like that:
What I was gripping about is that it does not get executed after
deploy_with_migrations, which is kind of weird. Since I have important tasks executed atafter_deployI cannot usedeploy_with_migrationsas this code will not be executed.March 23rd, 2007 at 4:13 am
I just opened a ticket for this exact problem because it is causing me the same grief. The ticket is over at http://dev.rubyonrails.org/ticket/7897
I’ll try to keep you updated. I have 3 solutions to this and waiting to hear back from Jamis or whomever wants to look into it before submitting a patch.
March 23rd, 2007 at 10:36 am
I’m glad to hear I’m not alone in my pain.
May 17th, 2007 at 6:47 pm
Just define :after_deploy_with_migrations task in your recipes file.
There is one caveat (feature?) though: (at least for me) after_deploy_with_migrations seems not to be executed if cap_deploy_with_migrations task fails at some point. Other that it works just fine.
May 17th, 2007 at 7:46 pm
This is only a workaround that does not fix the described underlying problem.