#!/bin/sh
dest=/var/www/myproj
GIT_WORK_TREE=$dest git checkout -f
$dest/manage.py collectstatic --noinput
$dest/manage.py migrate
touch $dest/myproj/wsgi.py
Running a git push to the prod server fires this hook and that's all. I could improve it by first checking out to a test environment to run django tests and, if everything passes, do a git checkout to production.
Plus, am I the only one using apache?