view fabfile.py @ 108:9ca05ec9b64e tip

Update buy links.
author Brian Neal <bgneal@gmail.com>
date Sat, 27 Sep 2014 12:36:06 -0500
parents 89d0511cb5c2
children
line wrap: on
line source
from fabric.api import cd, run

PYTHON = '/svr/django-sites/bns/bin/python'
WC_DIR = '/svr/django-sites/bns/bravenewsurf'
PROJ_DIR = WC_DIR + '/bns_website'

def update():
    """
    Runs hg pull -u.

    """
    with cd(WC_DIR):
        run('hg pull --update')


def collectstatic():
    """
    Runs the staticfiles collectstatic command to deploy static assets.

    """
    cmd = ('%s manage.py collectstatic '
        '--settings=settings.production --noinput') % PYTHON

    with cd(PROJ_DIR):
        run(cmd)


def cleanup():
    """
    Runs the cleanup management command.

    """
    cmd = '%s manage.py cleanup --settings=settings.production' % PYTHON

    with cd(PROJ_DIR):
        run(cmd)


def touch():
    """
    Touches the wsgi file to reload the Python code.

    """
    with cd(PROJ_DIR):
        run('touch apache/bns.wsgi')