bgneal@531: from fabric.api import cd, run bgneal@531: bgneal@655: PYTHON = '/svr/django-sites/sg101/bin/python' bgneal@655: PROJ_DIR = '/svr/django-sites/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')