bgneal@531: from fabric.api import cd, run bgneal@531: bgneal@531: PYTHON = '/home/var/django-sites/virtualenvs/sg101/bin/python' bgneal@531: WC_DIR = '/home/var/django-sites/virtualenvs/sg101/sg101' bgneal@592: PROJ_DIR = WC_DIR + '/sg101' bgneal@531: bgneal@531: def update(): bgneal@531: """ bgneal@546: Runs hg pull --update to pull changes and update to them. bgneal@531: bgneal@531: """ bgneal@531: with cd(PROJ_DIR): bgneal@546: run('hg pull --update') bgneal@531: bgneal@531: bgneal@531: def collectstatic(): bgneal@531: """ bgneal@531: Runs the staticfiles collectstatic command to deploy static assets. bgneal@531: bgneal@531: """ bgneal@531: cmd = ('%s manage.py collectstatic ' bgneal@531: '--settings=settings.production --noinput') % PYTHON bgneal@531: bgneal@531: with cd(PROJ_DIR): bgneal@531: run(cmd) bgneal@531: bgneal@531: bgneal@531: def touch(): bgneal@531: """ bgneal@531: Touches the wsgi file to reload the Python code. bgneal@531: bgneal@531: """ bgneal@531: with cd(PROJ_DIR): bgneal@531: run('touch apache/sg101.wsgi')