# HG changeset patch # User Brian Neal # Date 1334187994 18000 # Node ID db9c668736807d5756c4515a0e402cdbc32120d2 # Parent 5ff9c130f47f9235c225030fa90d35ffe347872c Creating a fabfile.py for fabric. diff -r 5ff9c130f47f -r db9c66873680 fabfile.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/fabfile.py Wed Apr 11 18:46:34 2012 -0500 @@ -0,0 +1,45 @@ +from fabric.api import cd, run + +PYTHON = '/home/var/django-sites/virtualenvs/madeira/bin/python' +WC_DIR = '/home/var/django-sites/virtualenvs/madeira/madeira' +PROJ_DIR = WC_DIR + '/madeira' + +def update(): + """ + Runs hg pull --update to pull changes and update to them. + + """ + with cd(PROJ_DIR): + run('hg pull --update') + + +def collectstatic(): + """ + Runs the staticfiles collectstatic command to deploy static assets. + + """ + cmd = ('%s manage.py collectstatic ' + '--settings=settings.production --noinput') % PYTHON + + with cd(PROJ_DIR): + run(cmd) + + +def cleanup(): + """ + Runs the cleanup management command. + + """ + cmd = '%s manage.py cleanup --settings=settings.production' % PYTHON + + with cd(PROJ_DIR): + run(cmd) + + +def touch(): + """ + Touches the wsgi file to reload the Python code. + + """ + with cd(PROJ_DIR): + run('touch apache/madeira.wsgi')