bgneal@107: from fabric.api import cd, run bgneal@33: bgneal@107: PYTHON = '/svr/django-sites/bns/bin/python' bgneal@107: WC_DIR = '/svr/django-sites/bns/bravenewsurf' bgneal@107: PROJ_DIR = WC_DIR + '/bns_website' bgneal@33: bgneal@36: def update(): bgneal@33: """ bgneal@36: Runs hg pull -u. bgneal@33: bgneal@33: """ bgneal@107: with cd(WC_DIR): bgneal@107: run('hg pull --update') bgneal@33: bgneal@33: bgneal@33: def collectstatic(): bgneal@33: """ bgneal@33: Runs the staticfiles collectstatic command to deploy static assets. bgneal@33: bgneal@33: """ bgneal@107: cmd = ('%s manage.py collectstatic ' bgneal@107: '--settings=settings.production --noinput') % PYTHON bgneal@33: bgneal@107: with cd(PROJ_DIR): bgneal@107: run(cmd) bgneal@107: bgneal@107: bgneal@107: def cleanup(): bgneal@107: """ bgneal@107: Runs the cleanup management command. bgneal@107: bgneal@107: """ bgneal@107: cmd = '%s manage.py cleanup --settings=settings.production' % PYTHON bgneal@107: bgneal@107: with cd(PROJ_DIR): bgneal@33: run(cmd) bgneal@33: bgneal@33: bgneal@33: def touch(): bgneal@33: """ bgneal@33: Touches the wsgi file to reload the Python code. bgneal@33: bgneal@33: """ bgneal@107: with cd(PROJ_DIR): bgneal@33: run('touch apache/bns.wsgi')