bgneal@531: from fabric.api import cd, run bgneal@531: bgneal@531: PYTHON = '/home/var/django-sites/virtualenvs/sg101/bin/python' bgneal@602: PROJ_DIR = '/home/var/django-sites/virtualenvs/sg101/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@602: '--settings=sg101.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@605: run('touch ./sg101/apache/sg101.wsgi')