From: dsc Date: Wed, 9 May 2012 19:07:18 +0000 (-0700) Subject: Fixes deployment. Argh, rsync -Crz, not rsync -Caz. X-Git-Url: http://git.less.ly:3516/?a=commitdiff_plain;h=7f4987290fdd4ede817942a64fc7e8d4561409e4;p=limn-bak.git Fixes deployment. Argh, rsync -Crz, not rsync -Caz. --- diff --git a/fabfile/__init__.py b/fabfile/__init__.py index 02b19f1..f4aaad9 100644 --- a/fabfile/__init__.py +++ b/fabfile/__init__.py @@ -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 diff --git a/fabfile/deploy.py b/fabfile/deploy.py index ded3e1b..2139204 100644 --- a/fabfile/deploy.py +++ b/fabfile/deploy.py @@ -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 diff --git a/fabfile/stages.py b/fabfile/stages.py index 26ef43a..0140fef 100644 --- a/fabfile/stages.py +++ b/fabfile/stages.py @@ -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'