Fixes deployment. Argh, rsync -Crz, not rsync -Caz.
authordsc <dsc@less.ly>
Wed, 9 May 2012 19:07:18 +0000 (12:07 -0700)
committerdsc <dsc@less.ly>
Wed, 9 May 2012 19:07:18 +0000 (12:07 -0700)
fabfile/__init__.py
fabfile/deploy.py
fabfile/stages.py

index 02b19f1..f4aaad9 100644 (file)
@@ -21,7 +21,9 @@ except ImportError:
         """
     sys.exit(1)
 
-import monkeypatch_sshproxy # my mind is blown. this totally works.
+# My mind is blown. This totally works.
+# see: https://github.com/fabric/fabric/issues/38#issuecomment-5608014
+import monkeypatch_sshproxy
 from util import *
 
 
@@ -32,7 +34,6 @@ from util import *
 env.project_name       = 'kraken-ui'
 env.colors             = True
 env.use_ssh_config     = True
-env.gateway            = 'bastion.wmflabs.org'
 
 
 ### Project Config
@@ -55,7 +56,8 @@ env.app_bundle_min     = p(env.app_bundle.replace('.js', '.min.js'))
 
 ### Setup Staging Environments
 
-# We declare stubs here to use @task and have them show up at the top level
+# Envs aren't declared with @task in the stages module so that we can
+# decorate them here and have them show up at the top level.
 import stages
 
 @task
index ded3e1b..2139204 100644 (file)
@@ -44,9 +44,9 @@ def pull():
 def sync_files():
     """ Copies `dist` package to deployment host.
     """
-    local("rsync -Caz -v %(work_dir)s %(user)s@%(host)s:%(target_dir)s/%(dist)s" % env)
+    local("rsync -Crz -v %(work_dir)s %(user)s@%(host)s:%(target_dir)s/" % env)
     # TODO: make sure the following works.
-    # rsync_project(local_dir=env.work_dir, remote_dir="%(user)s@%(host)s:%(target_dir)s/%(dist)s" % env)
+    # rsync_project(local_dir=env.work_dir, remote_dir="%(user)s@%(host)s:%(target_dir)s/" % env)
 
 @task
 @ensure_stage
index 26ef43a..0140fef 100644 (file)
@@ -3,7 +3,8 @@
 "Setup Staging Environments"
 
 from functools import wraps
-from fabric.api import env
+from fabric.api import env, abort
+from fabric.colors import white, blue, cyan, green, yellow, red, magenta
 
 __all__ = ('prod', 'stage', 'ensure_stage',)
 
@@ -25,6 +26,7 @@ def prod():
     """
     env.deploy_env = 'prod'
     env.hosts      = ['reportcard2.pmtpa.wmflabs']
+    env.gateway    = 'bastion.wmflabs.org'
     env.target_dir = '/srv/reportcard/kraken-ui'
     env.owner      = 'www-data'
     env.group      = 'www'