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