fixed conf_setup backup so it has proper values it was using ' and " too much

modified:   modules/conf_setup.py
	modified:   share/templates/meta/development.yml
	modified:   share/templates/meta/layout.yml
	modified:   share/templates/meta/staging.yml
This commit is contained in:
Ronny Abraham 2016-09-15 20:36:20 +03:00
parent 12c57354f7
commit 596b6e7da3
4 changed files with 36 additions and 39 deletions

View file

@ -118,58 +118,58 @@ def _modify_configuration(branch):
branch = config_yaml['project']['branch']
config_yaml['project']['name'] = "\"PROJECT_NAME\""
config_yaml['project']['name'] = 'PROJECT_NAME'
# we don't use 'paths/home' in anything other than dev
if branch == 'development':
config_yaml['project']['paths']['home'] = "\"PROJECT_NAME.prj\""
config_yaml['project']['paths']['home'] = 'PROJECT_NAME.prj'
config_yaml['project']['user'] = '"BRANCH_USER"'
config_yaml['project']['group'] = '"BRANCH_GROUP"'
config_yaml['project']['extension'] = '"BRANCH_NAME"'
config_yaml['project']['user'] = 'BRANCH_USER'
config_yaml['project']['group'] = 'BRANCH_GROUP'
config_yaml['project']['extension'] = 'BRANCH_EXT'
if config_yaml['project']['host'] != 'localhost':
config_yaml['project']['host'] = '"PROJECT_IP"'
config_yaml['project']['host'] = 'PROJECT_IP'
#
# database configuration
config_yaml['database']['name'] = '"PROJECT_NAME_{{branch}}"'.format(
config_yaml['database']['name'] = "PROJECT_NAME_{branch}".format(
branch=config_yaml['project']['extension'])
if config_yaml['database']['host'] == "docker":
config_yaml['database']['port'] = '"DOCKER_PORT"'
config_yaml['database']['port'] = 'DOCKER_PORT'
else:
config_yaml['database']['host'] = '"DATABASE_IP"'
config_yaml['database']['host'] = 'DATABASE_IP'
#
# database user name values
config_yaml['database']['users']['admin']['name'] = \
'"DATABASE_ADMIN_NAME"'
'DATABASE_ADMIN_NAME'
config_yaml['database']['users']['admin']['pass'] = \
'"DATABASE_ADMIN_PASS"'
'DATABASE_ADMIN_PASS'
config_yaml['database']['users']['default']['name'] = \
'"DATABASE_USER_NAME"'
'DATABASE_USER_NAME'
config_yaml['database']['users']['default']['pass'] = \
'"DATABASE_USER_PASS"'
'DATABASE_USER_PASS'
#
# django configuration
config_yaml['django']['port'] = '"DJANGO_PORT"'
config_yaml['django']['host'] = '"DJANGO_IP"'
config_yaml['django']['port'] = 'DJANGO_PORT'
config_yaml['django']['host'] = 'DJANGO_IP'
#
# nginx and virtualenv configuration
config_yaml['nginx']['port'] = '"NGINX_PORT"'
config_yaml['nginx']['port'] = 'NGINX_PORT'
if hasattr(config_yaml['virtualenv'], 'name'):
config_yaml['virtualenv']['name'] = '"PROJECT_NAME"'
config_yaml['virtualenv']['name'] = 'PROJECT_NAME'
return config_yaml

View file

@ -1,7 +1,7 @@
database:
backend: postgresql_psycopg2
host: docker
name: PROJECT_NAME_dev
name: PROJECT_NAME_BRANCH_EXT
port: DOCKER_PORT
users:
admin: {name: DATABASE_ADMIN_NAME, pass: DATABASE_ADMIN_PASS}
@ -35,7 +35,7 @@ nginx:
overrides: [null]
project:
branch: development
extension: dev
extension: BRANCH_EXT
group: BRANCH_GROUP
host: localhost
name: PROJECT_NAME
@ -45,4 +45,4 @@ project:
rootpath: /usr/local/var/www
supervisor:
paths: {conf: /usr/local/etc/supervisor/conf.d}
virtualenv: {name: PROJECT_NAME, workon: /Users/ronny/.virtualenvs}
virtualenv: {name: debates_eu, workon: /Users/ronny/.virtualenvs}

View file

@ -14,9 +14,9 @@ paths:
fabric:
root: "scripts/tools/fabric"
templates:
conf: "templates/conf"
meta: "templates/meta"
readmes: "templates/readmes"
conf: "share/templates/conf"
meta: "share/templates/meta"
readmes: "share/templates/readmes"
backups:
root: "backups"

View file

@ -1,20 +1,8 @@
project:
name: PROJECT_NAME
branch: BRANCH_NAME
extension: BRANCH_EXT
host: PROJECT_IP
paths: {root: /home/website}
user: BRANCH_USER
group: BRANCH_GROUP
sudo: true
database:
port: 5432
name: PROJECT_NAME_BRANCH_EXT
host: DATABASE_IP
backend: postgresql_psycopg2
host: DATABASE_IP
name: PROJECT_NAME_BRANCH_EXT
port: 5432
users:
admin: {name: DATABASE_ADMIN_NAME, pass: DATABASE_ADMIN_PASS}
default: {name: DATABASE_USER_NAME, pass: DATABASE_USER_PASS}
@ -37,6 +25,15 @@ nginx:
paths: {available: sites-available, enabled: sites-enabled, root: /etc/nginx}
port: NGINX_PORT
overrides: [null]
project:
branch: staging
extension: BRANCH_EXT
group: BRANCH_GROUP
host: PROJECT_IP
name: PROJECT_NAME
paths: {root: /home/website}
sudo: true
user: BRANCH_USER
rootpath: /var/www
supervisor:
paths: {conf: /etc/supervisor/conf.d}
@ -48,4 +45,4 @@ templates:
conf: {output: nginx.conf, source: unixsocket.jinja2}
file: unixsocket.jinja2
path: scripts/conf/nginx
virtualenv: {name: PROJECT_NAME, workon: /home/website/.virtualenvs}
virtualenv: {workon: /home/website/.virtualenvs}