From ae6548e168538a51b4a789343db4150c61c12c30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Floure?= Date: Mon, 9 Mar 2020 11:57:18 +0100 Subject: [PATCH] Read database host and user from environment (used by CI pipeline) --- .gitlab-ci.yml | 2 ++ uncloud/uncloud/settings.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2562c11..e54cc4d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,6 +9,8 @@ run-tests: services: - postgres:latest variables: + DATABASE_HOST: postgres + DATABASE_USER: postgres POSTGRES_HOST_AUTH_METHOD: trust before_script: - dnf install -y python3-devel python3-pip libpq-devel openldap-devel gcc diff --git a/uncloud/uncloud/settings.py b/uncloud/uncloud/settings.py index cc0ec3a..77cc20f 100644 --- a/uncloud/uncloud/settings.py +++ b/uncloud/uncloud/settings.py @@ -28,6 +28,8 @@ except ModuleNotFoundError: 'default': { 'ENGINE': 'django.db.backends.postgresql', 'NAME': uncloud.secrets.POSTGRESQL_DB_NAME, + 'HOST': os.environ.get('DATABASE_HOST'), + 'USER': os.environ.get('DATABASE_USER'), } }