Read database host and user from environment (used by CI pipeline)

This commit is contained in:
fnux 2020-03-09 11:57:18 +01:00
parent 0e4068cea8
commit ae6548e168
2 changed files with 4 additions and 0 deletions

View file

@ -9,6 +9,8 @@ run-tests:
services: services:
- postgres:latest - postgres:latest
variables: variables:
DATABASE_HOST: postgres
DATABASE_USER: postgres
POSTGRES_HOST_AUTH_METHOD: trust POSTGRES_HOST_AUTH_METHOD: trust
before_script: before_script:
- dnf install -y python3-devel python3-pip libpq-devel openldap-devel gcc - dnf install -y python3-devel python3-pip libpq-devel openldap-devel gcc

View file

@ -28,6 +28,8 @@ except ModuleNotFoundError:
'default': { 'default': {
'ENGINE': 'django.db.backends.postgresql', 'ENGINE': 'django.db.backends.postgresql',
'NAME': uncloud.secrets.POSTGRESQL_DB_NAME, 'NAME': uncloud.secrets.POSTGRESQL_DB_NAME,
'HOST': os.environ.get('DATABASE_HOST'),
'USER': os.environ.get('DATABASE_USER'),
} }
} }