comparison 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
comparison
equal deleted inserted replaced
57:5ff9c130f47f 58:db9c66873680
1 from fabric.api import cd, run
2
3 PYTHON = '/home/var/django-sites/virtualenvs/madeira/bin/python'
4 WC_DIR = '/home/var/django-sites/virtualenvs/madeira/madeira'
5 PROJ_DIR = WC_DIR + '/madeira'
6
7 def update():
8 """
9 Runs hg pull --update to pull changes and update to them.
10
11 """
12 with cd(PROJ_DIR):
13 run('hg pull --update')
14
15
16 def collectstatic():
17 """
18 Runs the staticfiles collectstatic command to deploy static assets.
19
20 """
21 cmd = ('%s manage.py collectstatic '
22 '--settings=settings.production --noinput') % PYTHON
23
24 with cd(PROJ_DIR):
25 run(cmd)
26
27
28 def cleanup():
29 """
30 Runs the cleanup management command.
31
32 """
33 cmd = '%s manage.py cleanup --settings=settings.production' % PYTHON
34
35 with cd(PROJ_DIR):
36 run(cmd)
37
38
39 def touch():
40 """
41 Touches the wsgi file to reload the Python code.
42
43 """
44 with cd(PROJ_DIR):
45 run('touch apache/madeira.wsgi')