annotate fabfile.py @ 107:89d0511cb5c2

Update fabric file for production server (finally!).
author Brian Neal <bgneal@gmail.com>
date Tue, 15 Oct 2013 21:00:21 -0500
parents 1eb4b4072888
children
rev   line source
bgneal@107 1 from fabric.api import cd, run
bgneal@33 2
bgneal@107 3 PYTHON = '/svr/django-sites/bns/bin/python'
bgneal@107 4 WC_DIR = '/svr/django-sites/bns/bravenewsurf'
bgneal@107 5 PROJ_DIR = WC_DIR + '/bns_website'
bgneal@33 6
bgneal@36 7 def update():
bgneal@33 8 """
bgneal@36 9 Runs hg pull -u.
bgneal@33 10
bgneal@33 11 """
bgneal@107 12 with cd(WC_DIR):
bgneal@107 13 run('hg pull --update')
bgneal@33 14
bgneal@33 15
bgneal@33 16 def collectstatic():
bgneal@33 17 """
bgneal@33 18 Runs the staticfiles collectstatic command to deploy static assets.
bgneal@33 19
bgneal@33 20 """
bgneal@107 21 cmd = ('%s manage.py collectstatic '
bgneal@107 22 '--settings=settings.production --noinput') % PYTHON
bgneal@33 23
bgneal@107 24 with cd(PROJ_DIR):
bgneal@107 25 run(cmd)
bgneal@107 26
bgneal@107 27
bgneal@107 28 def cleanup():
bgneal@107 29 """
bgneal@107 30 Runs the cleanup management command.
bgneal@107 31
bgneal@107 32 """
bgneal@107 33 cmd = '%s manage.py cleanup --settings=settings.production' % PYTHON
bgneal@107 34
bgneal@107 35 with cd(PROJ_DIR):
bgneal@33 36 run(cmd)
bgneal@33 37
bgneal@33 38
bgneal@33 39 def touch():
bgneal@33 40 """
bgneal@33 41 Touches the wsgi file to reload the Python code.
bgneal@33 42
bgneal@33 43 """
bgneal@107 44 with cd(PROJ_DIR):
bgneal@33 45 run('touch apache/bns.wsgi')