Use a json config file for fpdc configmap

Signed-off-by: Clement Verna <cverna@tutanota.com>
This commit is contained in:
Clement Verna 2018-09-26 14:04:04 +02:00
parent 913ff566ec
commit cfb47826bb
2 changed files with 9 additions and 32 deletions

View file

@ -27,7 +27,7 @@ spec:
protocol: TCP
volumesMounts:
- name: config-volume
mountPath: /opt/app-root/src/fpdc/settings/
mountPath: /opt/app-root/config/
readOnly: true
readinessProbe:
timeoutSeconds: 1

View file

@ -6,38 +6,15 @@ metadata:
labels:
app: fpdc
data:
prod.py: |-
# Django settings for fpdc project.
from base import *
config.json: |-
{
{% if env == 'staging' %}
SECRET_KEY = '{{ stg_fpdc_secret_key }}'
"SECRET_KEY": "{{ stg_fpdc_secret_key }}",
"DB_PASSWORD": "{{ fpdc_stg_db_pass }}",
"DB_HOST": "{{ fpdc_stg_db_server }}"
{% else %}
SECRET_KEY = '{{ fpdc_secret_key }}'
"SECRET_KEY": "{{ fpdc_secret_key }}",
"DB_PASSWORD": "{{ fpdc_db_pass }}",
"DB_HOST": "{{ fpdc_db_server }}"
{% endif %}
DEBUG = False
ALLOWED_HOSTS = []
{% if env == 'staging' %}
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'fpdc',
'USER': 'fpdc',
'PASSWORD': '{{ fpdc_stg_db_pass }}',
'HOST': '{{ fpdc_stg_db_server }}',
'PORT': '',
}
}
{% else %}
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'fpdc',
'USER': 'fpdc',
'PASSWORD': '{{ fpdc_db_pass }}',
'HOST': '{{ fpdc_db_server }}',
'PORT': '',
}
}
{% endif %}