Gunicorn Simple Release Script
March 31, 2011
Here's a simple script, making use of http://drumcoder.co.uk/blog/2011/mar/31/sudo-restart-gunicorn/, which will upload the latest source, run a django syncdb
, then a south migrate
, and then finally send a HUP
signal to gunicorn.
To scripts are required, upload and restart. Here's the upload script:
SRC_DIR=~/path/to/django/app/ DEST_DIR=user@server.co.uk:path/to/django/app EXCLUDES=~/path/to/django/app/upload_excludes.txt RSYNC_OPTS="-avz --exclude-from=$EXCLUDES" …