c256da53789f

Add a publish task to the fabfile.
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Sat, 09 Jan 2010 02:18:15 -0500
parents b7e80769ceb9
children 4e269b372970
branches/tags (none)
files fabfile.py

Changes

--- a/fabfile.py	Sat Jan 09 00:12:56 2010 -0500
+++ b/fabfile.py	Sat Jan 09 02:18:15 2010 -0500
@@ -1,4 +1,11 @@
 from fabric.api import *
+import os
+import fabric.contrib.project as project
+
+PROD = 'sjl.webfactional.com'
+DEST_PATH = '/home/sjl/webapps/slc/'
+ROOT_PATH = os.path.abspath(os.path.dirname(__file__))
+DEPLOY_PATH = os.path.join(ROOT_PATH, 'deploy')
 
 def clean():
     local('rm -rf ./deploy')
@@ -16,3 +23,12 @@
 
 def smush():
     local('smusher ./media/images')
+
+@hosts(PROD)
+def publish():
+    regen()
+    project.rsync_project(
+        remote_dir=DEST_PATH,
+        local_dir=DEPLOY_PATH.rstrip('/') + '/',
+        delete=True
+    )