Mercurial > public > sg101
annotate fabfile.py @ 545:cb298c8eb039
Change fabfile to use hg instead of svn.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Fri, 13 Jan 2012 19:07:19 -0600 |
parents | 1f92a53db575 |
children | 0d007c8c4851 |
rev | line source |
---|---|
bgneal@531 | 1 from fabric.api import cd, run |
bgneal@531 | 2 |
bgneal@531 | 3 PYTHON = '/home/var/django-sites/virtualenvs/sg101/bin/python' |
bgneal@531 | 4 WC_DIR = '/home/var/django-sites/virtualenvs/sg101/sg101' |
bgneal@531 | 5 PROJ_DIR = WC_DIR + '/gpp' |
bgneal@531 | 6 |
bgneal@531 | 7 def update(): |
bgneal@531 | 8 """ |
bgneal@545 | 9 Runs hg pull -U to pull changes and update to them. |
bgneal@531 | 10 |
bgneal@531 | 11 """ |
bgneal@531 | 12 with cd(PROJ_DIR): |
bgneal@545 | 13 run('hg pull -U') |
bgneal@531 | 14 |
bgneal@531 | 15 |
bgneal@531 | 16 def collectstatic(): |
bgneal@531 | 17 """ |
bgneal@531 | 18 Runs the staticfiles collectstatic command to deploy static assets. |
bgneal@531 | 19 |
bgneal@531 | 20 """ |
bgneal@531 | 21 cmd = ('%s manage.py collectstatic ' |
bgneal@531 | 22 '--settings=settings.production --noinput') % PYTHON |
bgneal@531 | 23 |
bgneal@531 | 24 with cd(PROJ_DIR): |
bgneal@531 | 25 run(cmd) |
bgneal@531 | 26 |
bgneal@531 | 27 |
bgneal@531 | 28 def touch(): |
bgneal@531 | 29 """ |
bgneal@531 | 30 Touches the wsgi file to reload the Python code. |
bgneal@531 | 31 |
bgneal@531 | 32 """ |
bgneal@531 | 33 with cd(PROJ_DIR): |
bgneal@531 | 34 run('touch apache/sg101.wsgi') |