bgneal@58: from fabric.api import cd, run bgneal@58: bgneal@99: PYTHON = '/svr/django-sites/madeira/bin/python' bgneal@99: WC_DIR = '/svr/django-sites/madeira/madeira' bgneal@74: PROJ_DIR = WC_DIR bgneal@58: bgneal@58: def update(): bgneal@58: """ bgneal@58: Runs hg pull --update to pull changes and update to them. bgneal@58: bgneal@58: """ bgneal@58: with cd(PROJ_DIR): bgneal@58: run('hg pull --update') bgneal@58: bgneal@58: bgneal@58: def collectstatic(): bgneal@58: """ bgneal@58: Runs the staticfiles collectstatic command to deploy static assets. bgneal@58: bgneal@58: """ bgneal@58: cmd = ('%s manage.py collectstatic ' bgneal@74: '--settings=madeira.settings.production --noinput') % PYTHON bgneal@58: bgneal@58: with cd(PROJ_DIR): bgneal@58: run(cmd) bgneal@58: bgneal@58: bgneal@58: def cleanup(): bgneal@58: """ bgneal@168: Runs any/all cleanup-type management commands. bgneal@58: bgneal@58: """ bgneal@168: cmd = '%s manage.py clearsessions --settings=madeira.settings.production' % PYTHON bgneal@58: bgneal@58: with cd(PROJ_DIR): bgneal@58: run(cmd) bgneal@58: bgneal@58: bgneal@58: def touch(): bgneal@58: """ bgneal@58: Touches the wsgi file to reload the Python code. bgneal@58: bgneal@58: """ bgneal@58: with cd(PROJ_DIR): bgneal@77: run('touch madeira/apache/madeira.wsgi')