From 0f56f81bf34416cdd64c777df03186ff2d1745a2 Mon Sep 17 00:00:00 2001 From: Ronny Abraham Date: Thu, 10 Nov 2016 22:38:26 +0200 Subject: [PATCH] fixed deploy.media initialize.environment call to get_config for the destination config, otherwise it overwrites the global env variable modified: modules/deploy.py --- modules/deploy.py | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/modules/deploy.py b/modules/deploy.py index fcf7f29..ec1515c 100644 --- a/modules/deploy.py +++ b/modules/deploy.py @@ -337,9 +337,13 @@ def media(source_branch): import initialize - print configuration.project.branch + print "project.branch: %s" % configuration.project.branch - configuration_src = initialize.environment(source_branch) + # + # if we use initialize.environemnt, we will overwrite all project + # information, using get_config instead + + configuration_src = initialize.get_config(source_branch) configuration_dst = configuration print "branch_src: %s" % configuration_src.project.branch @@ -389,10 +393,21 @@ def media(source_branch): remote_dir = dynamic_dst local_dir = dynamic_src upstream = True - # configuration_dst = initialize.environment( - # destination_branch) + + # TODO + # get rid of all this + # + # rsync relies on env.host_string to determine what the username and + # host is + # print "before: %s" % env.host_string + # configuration_dst = initialize.environment(source_branch) + # print "after: %s" % env.host_string + # import sys + # sys.exit() print "upstream: %s" % upstream + print "remote_dir: %s" % remote_dir + print "local_dir: %s" % local_dir print "\ncopy from {src} to {dst}\n".format( src=configuration_src.project.host, dst=configuration_dst.project.host) @@ -403,6 +418,8 @@ def media(source_branch): upstream = False print "upstream: %s" % upstream + print "remote_dir: %s" % remote_dir + print "local_dir: %s" % local_dir print "\ncopy from {src} to {dst}\n".format( src=configuration_src.project.host, dst=configuration_dst.project.host) @@ -411,17 +428,17 @@ def media(source_branch): return cmd_msg = "rsync_project(remote_dir={remote_dir}, " \ - "local_dir=local_dir, upload=upstream)".format( + "local_dir={local_dir}, upload={upstream})".format( remote_dir=remote_dir, local_dir=local_dir, upstream=upstream) print cmd_msg - # from fabric.contrib.project import rsync_project - # rsync_project(remote_dir=remote_dir, - # local_dir=local_dir, - # upload=upstream) + from fabric.contrib.project import rsync_project + rsync_project(remote_dir=remote_dir, + local_dir=local_dir, + upload=upstream) @task