Commit 6c019caa authored by Mathias Stelzer's avatar Mathias Stelzer

ci fix postgres settings

parent 7dc73c43
Pipeline #827 failed with stages
in 4 minutes and 7 seconds
......@@ -30,6 +30,7 @@ variables: &variables
<<: *variables
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_HOST: postgres
POSTGRES_PASSWORD: ""
before_script:
- pip install tox
......
......@@ -5,11 +5,18 @@ from .settings import *
DATABASES['default']['ENGINE'] = 'django.db.backends.postgresql'
DATABASES['default']['NAME'] = 'django-model-permissions'
POSTGRES_NAME = os.environ.get('POSTGRES_DB', None)
if POSTGRES_NAME is not None:
DATABASES['NAME'] = POSTGRES_NAME
HOST = os.environ.get('DB_HOST', None)
if HOST is not None:
DATABASES['HOST'] = HOST
POSTGRES_USER = os.environ.get('POSTGRES_USER', None)
if POSTGRES_USER is not None:
DATABASES['USER'] = POSTGRES_USER
HOST = os.environ.get('DB_HOST', None)
if HOST is not None:
DATABASES['HOST'] = HOST
POSTGRES_HOST = os.environ.get('POSTGRES_HOST', None)
if POSTGRES_HOST is not None:
DATABASES['HOST'] = POSTGRES_HOST
POSTGRES_PASSWORD = os.environ.get('POSTGRES_PASSWORD', None)
if POSTGRES_PASSWORD is not None:
DATABASES['PASSWORD'] = POSTGRES_PASSWORD
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment