Mercurial > public > bravenewsurf
annotate 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 |
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') |