fixed project.branch variable storage

modified:   modules/conf_setup.py
	modified:   share/templates/meta/staging.yml
This commit is contained in:
Ronny Abraham 2016-09-15 21:15:32 +03:00
parent 23a8a0ac45
commit ab69f72aff
2 changed files with 7 additions and 5 deletions

View file

@ -77,8 +77,8 @@ def _backup_meta():
# the development.yml file needs to be # the development.yml file needs to be
# modified before it can be copied over # modified before it can be copied over
_store_configuration(config_dev) _store_configuration(config_dev, 'development')
_store_configuration(config_stg) _store_configuration(config_stg, 'staging')
def _backup_readmes(): def _backup_readmes():
@ -123,6 +123,8 @@ def _modify_configuration(branch):
# we don't use 'paths/home' in anything other than dev # we don't use 'paths/home' in anything other than dev
if branch == 'development': if branch == 'development':
config_yaml['project']['paths']['home'] = 'PROJECT_NAME.prj' config_yaml['project']['paths']['home'] = 'PROJECT_NAME.prj'
else:
config_yaml['project']['branch'] = "BRANCH_NAME"
config_yaml['project']['user'] = 'BRANCH_USER' config_yaml['project']['user'] = 'BRANCH_USER'
config_yaml['project']['group'] = 'BRANCH_GROUP' config_yaml['project']['group'] = 'BRANCH_GROUP'
@ -174,7 +176,7 @@ def _modify_configuration(branch):
return config_yaml return config_yaml
def _store_configuration(config_dict): def _store_configuration(config_dict, branch):
""" """
takes config dictionary converts it to a yaml file object, takes config dictionary converts it to a yaml file object,
then saves it under the appropriate file name then saves it under the appropriate file name
@ -188,7 +190,7 @@ def _store_configuration(config_dict):
import yaml import yaml
from fabric.operations import put from fabric.operations import put
branch_name = config_dict['project']['branch'] + ".yml" branch_name = branch + ".yml"
dest_path = os.path.join( dest_path = os.path.join(
configuration.tools.fabric.templates.meta, configuration.tools.fabric.templates.meta,

View file

@ -26,7 +26,7 @@ nginx:
port: NGINX_PORT port: NGINX_PORT
overrides: [null] overrides: [null]
project: project:
branch: staging branch: BRANCH_NAME
extension: BRANCH_EXT extension: BRANCH_EXT
group: BRANCH_GROUP group: BRANCH_GROUP
host: PROJECT_IP host: PROJECT_IP