Permalink
Browse files

add fabfile.py

  • Loading branch information...
1 parent e35b37c commit 9723ff1db02280616327f59c0b84a7d2cca8df6a @vicalloy committed Jul 5, 2012
Showing with 41 additions and 0 deletions.
  1. +3 −0 .gitignore
  2. +38 −0 fabfile.py
View
@@ -1,8 +1,11 @@
*.pyc
*.swp
*.sqlite
+fabsettings.py
env/
ref/
+sites/settings/pre.py
+sites/settings/local.py
sites/media/
sites/taggit_templatetags/
sites/collectedstatic/
View
@@ -0,0 +1,38 @@
+# -*- coding: UTF-8 -*-
+import os
+from contextlib import contextmanager as __ctxmgr
+
+from fabric.api import *
+from fabric.decorators import runs_once
+
+import fabsettings as cfg
+
+#host settings
+env.hosts = ['vicalloy@jstwind.com']
+env.password = cfg.PASSWORD
+#env.passwords = fabsettings.PASSWORDS
+
+#custom settings
+env.deploy_dir = '/home/vicalloy/webapps/jstwind/timeline-site'
+env.activate = 'source %s' % os.path.join(env.deploy_dir, 'env/bin/activate')
+env.mg = 'python %s' % os.path.join(env.deploy_dir, 'sites', 'manage.py ')
+
+@__ctxmgr
+def __virtualenv():
+ with cd(env.deploy_dir):
+ with prefix(env.activate):
+ yield
+
+
+def reload():
+ wsgi = os.path.join(env.deploy_dir, 'deploy', 'dj_scaffold.wsgi')
+ run("touch %s" % wsgi)
+
+
+def update():
+ with __virtualenv():
+ run("git pull")
+ run('%s syncdb' % env.mg)
+ run('%s migrate' % env.mg)
+ run('%s compress --force' % env.mg)
+ reload()

0 comments on commit 9723ff1

Please sign in to comment.