comparison 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
comparison
equal deleted inserted replaced
32:b34d5e7affe3 33:b5329e6ad828
1 from fabric.api import cd, env, local, put, run
2
3
4 def up():
5 """
6 Runs hg up.
7
8 """
9 with cd('/home/var/django-sites/bns/bns/'):
10 run('hg up')
11
12
13 def collectstatic():
14 """
15 Runs the staticfiles collectstatic command to deploy static assets.
16
17 """
18 cmd = ('. ./env.bash && python manage.py collectstatic '
19 '--settings=settings.production --noinput')
20
21 with cd('/home/var/django-sites/bns/bns/bns_website/'):
22 run(cmd)
23
24
25 def touch():
26 """
27 Touches the wsgi file to reload the Python code.
28
29 """
30 with cd('/home/var/django-sites/bns/bns/bns_website/'):
31 run('touch apache/bns.wsgi')