Mercurial > public > madeira
annotate fabfile.py @ 58:db9c66873680
Creating a fabfile.py for fabric.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Wed, 11 Apr 2012 18:46:34 -0500 |
parents | |
children | 49f704e58400 |
rev | line source |
---|---|
bgneal@58 | 1 from fabric.api import cd, run |
bgneal@58 | 2 |
bgneal@58 | 3 PYTHON = '/home/var/django-sites/virtualenvs/madeira/bin/python' |
bgneal@58 | 4 WC_DIR = '/home/var/django-sites/virtualenvs/madeira/madeira' |
bgneal@58 | 5 PROJ_DIR = WC_DIR + '/madeira' |
bgneal@58 | 6 |
bgneal@58 | 7 def update(): |
bgneal@58 | 8 """ |
bgneal@58 | 9 Runs hg pull --update to pull changes and update to them. |
bgneal@58 | 10 |
bgneal@58 | 11 """ |
bgneal@58 | 12 with cd(PROJ_DIR): |
bgneal@58 | 13 run('hg pull --update') |
bgneal@58 | 14 |
bgneal@58 | 15 |
bgneal@58 | 16 def collectstatic(): |
bgneal@58 | 17 """ |
bgneal@58 | 18 Runs the staticfiles collectstatic command to deploy static assets. |
bgneal@58 | 19 |
bgneal@58 | 20 """ |
bgneal@58 | 21 cmd = ('%s manage.py collectstatic ' |
bgneal@58 | 22 '--settings=settings.production --noinput') % PYTHON |
bgneal@58 | 23 |
bgneal@58 | 24 with cd(PROJ_DIR): |
bgneal@58 | 25 run(cmd) |
bgneal@58 | 26 |
bgneal@58 | 27 |
bgneal@58 | 28 def cleanup(): |
bgneal@58 | 29 """ |
bgneal@58 | 30 Runs the cleanup management command. |
bgneal@58 | 31 |
bgneal@58 | 32 """ |
bgneal@58 | 33 cmd = '%s manage.py cleanup --settings=settings.production' % PYTHON |
bgneal@58 | 34 |
bgneal@58 | 35 with cd(PROJ_DIR): |
bgneal@58 | 36 run(cmd) |
bgneal@58 | 37 |
bgneal@58 | 38 |
bgneal@58 | 39 def touch(): |
bgneal@58 | 40 """ |
bgneal@58 | 41 Touches the wsgi file to reload the Python code. |
bgneal@58 | 42 |
bgneal@58 | 43 """ |
bgneal@58 | 44 with cd(PROJ_DIR): |
bgneal@58 | 45 run('touch apache/madeira.wsgi') |