# HG changeset patch # User Brian Neal # Date 1320516047 18000 # Node ID b5329e6ad8288c99a161e1176fa3c418b74acf8b # Parent b34d5e7affe34bdf59dfd1e00f8b5c91e410f49d Added a fabric file to automate some tasks on the production server. diff -r b34d5e7affe3 -r b5329e6ad828 fabfile.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/fabfile.py Sat Nov 05 13:00:47 2011 -0500 @@ -0,0 +1,31 @@ +from fabric.api import cd, env, local, put, run + + +def up(): + """ + Runs hg up. + + """ + with cd('/home/var/django-sites/bns/bns/'): + run('hg up') + + +def collectstatic(): + """ + Runs the staticfiles collectstatic command to deploy static assets. + + """ + cmd = ('. ./env.bash && python manage.py collectstatic ' + '--settings=settings.production --noinput') + + with cd('/home/var/django-sites/bns/bns/bns_website/'): + run(cmd) + + +def touch(): + """ + Touches the wsgi file to reload the Python code. + + """ + with cd('/home/var/django-sites/bns/bns/bns_website/'): + run('touch apache/bns.wsgi')