fab release pull update touch
The above will work on release version, will pull in changes from repo (hg in my case), will update to tip (or any tag I want), remove any *.pyc files and recompile and finally touch wsgi file. All these (release, pull, update, touch) are custom written python functions using fabric library.
If I want to restart apache, I use this (could have combined it with previous example and it would work)
fab apache_restart
Fabric is joy to use, very easy to write powerful deployment scripts and has good documentation: highly recommended.
If someone has a link to a good article / book / video about best practices with this, please post it?
There's a lot of talk about how someone did massively scallable systems or deployments (and it's really interesting, lots of cool engineering problems & solutions there), but a real world "here's what we figured works really well for us for a smaller-scale distributed operation" would be really useful, too.