From cf4ec31b90e5cbf0da3df78665dde53375761bb3 Mon Sep 17 00:00:00 2001 From: Ngure Nyaga Date: Wed, 14 Jul 2021 11:54:42 +0300 Subject: [PATCH] fix: change secrets mount path --- cloudbuild.yaml | 2 +- config/settings/base.py | 4 ++++ envs/.gitkeep | 0 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 envs/.gitkeep diff --git a/cloudbuild.yaml b/cloudbuild.yaml index 809f6379..ef203c62 100644 --- a/cloudbuild.yaml +++ b/cloudbuild.yaml @@ -31,7 +31,7 @@ steps: '--max-instances', '4', '--memory', '256M', '--cpu', '1', - '--update-secrets', '/app/.env=mle_django_settings:latest' + '--update-secrets', '/app/envs/.env=mle_django_settings:latest' ] images: diff --git a/config/settings/base.py b/config/settings/base.py index 333b6c46..15060cec 100644 --- a/config/settings/base.py +++ b/config/settings/base.py @@ -11,7 +11,11 @@ ROOT_DIR = Path(__file__).resolve(strict=True).parent.parent.parent # pepfar_mle/ APPS_DIR = ROOT_DIR / "pepfar_mle" +ENVS_DIR = ROOT_DIR / "envs" +ENV_PATH = os.path.join(ENVS_DIR, ".env") + env = environ.Env() +env.read_env(ENV_PATH) if os.environ.get("GOOGLE_CLOUD_PROJECT", None): project_id = os.environ.get("GOOGLE_CLOUD_PROJECT") diff --git a/envs/.gitkeep b/envs/.gitkeep new file mode 100644 index 00000000..e69de29b