From ab69f72aff668b4e9b2d65bcd53313a7811d3f95 Mon Sep 17 00:00:00 2001 From: Ronny Abraham Date: Thu, 15 Sep 2016 21:15:32 +0300 Subject: [PATCH] fixed project.branch variable storage modified: modules/conf_setup.py modified: share/templates/meta/staging.yml --- modules/conf_setup.py | 10 ++++++---- share/templates/meta/staging.yml | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/conf_setup.py b/modules/conf_setup.py index 1bb3bd3..d8f033d 100644 --- a/modules/conf_setup.py +++ b/modules/conf_setup.py @@ -77,8 +77,8 @@ def _backup_meta(): # the development.yml file needs to be # modified before it can be copied over - _store_configuration(config_dev) - _store_configuration(config_stg) + _store_configuration(config_dev, 'development') + _store_configuration(config_stg, 'staging') def _backup_readmes(): @@ -123,6 +123,8 @@ def _modify_configuration(branch): # we don't use 'paths/home' in anything other than dev if branch == 'development': config_yaml['project']['paths']['home'] = 'PROJECT_NAME.prj' + else: + config_yaml['project']['branch'] = "BRANCH_NAME" config_yaml['project']['user'] = 'BRANCH_USER' config_yaml['project']['group'] = 'BRANCH_GROUP' @@ -174,7 +176,7 @@ def _modify_configuration(branch): return config_yaml -def _store_configuration(config_dict): +def _store_configuration(config_dict, branch): """ takes config dictionary converts it to a yaml file object, then saves it under the appropriate file name @@ -188,7 +190,7 @@ def _store_configuration(config_dict): import yaml from fabric.operations import put - branch_name = config_dict['project']['branch'] + ".yml" + branch_name = branch + ".yml" dest_path = os.path.join( configuration.tools.fabric.templates.meta, diff --git a/share/templates/meta/staging.yml b/share/templates/meta/staging.yml index 66ac957..ed3e591 100644 --- a/share/templates/meta/staging.yml +++ b/share/templates/meta/staging.yml @@ -26,7 +26,7 @@ nginx: port: NGINX_PORT overrides: [null] project: - branch: staging + branch: BRANCH_NAME extension: BRANCH_EXT group: BRANCH_GROUP host: PROJECT_IP