Mercurial > public > bravenewsurf
annotate fabfile.py @ 33:b5329e6ad828
Added a fabric file to automate some tasks on the production server.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sat, 05 Nov 2011 13:00:47 -0500 |
parents | |
children | 1eb4b4072888 |
rev | line source |
---|---|
bgneal@33 | 1 from fabric.api import cd, env, local, put, run |
bgneal@33 | 2 |
bgneal@33 | 3 |
bgneal@33 | 4 def up(): |
bgneal@33 | 5 """ |
bgneal@33 | 6 Runs hg up. |
bgneal@33 | 7 |
bgneal@33 | 8 """ |
bgneal@33 | 9 with cd('/home/var/django-sites/bns/bns/'): |
bgneal@33 | 10 run('hg up') |
bgneal@33 | 11 |
bgneal@33 | 12 |
bgneal@33 | 13 def collectstatic(): |
bgneal@33 | 14 """ |
bgneal@33 | 15 Runs the staticfiles collectstatic command to deploy static assets. |
bgneal@33 | 16 |
bgneal@33 | 17 """ |
bgneal@33 | 18 cmd = ('. ./env.bash && python manage.py collectstatic ' |
bgneal@33 | 19 '--settings=settings.production --noinput') |
bgneal@33 | 20 |
bgneal@33 | 21 with cd('/home/var/django-sites/bns/bns/bns_website/'): |
bgneal@33 | 22 run(cmd) |
bgneal@33 | 23 |
bgneal@33 | 24 |
bgneal@33 | 25 def touch(): |
bgneal@33 | 26 """ |
bgneal@33 | 27 Touches the wsgi file to reload the Python code. |
bgneal@33 | 28 |
bgneal@33 | 29 """ |
bgneal@33 | 30 with cd('/home/var/django-sites/bns/bns/bns_website/'): |
bgneal@33 | 31 run('touch apache/bns.wsgi') |