From 16c6776baf88c886ce7416579f79c6a41351d7d7 Mon Sep 17 00:00:00 2001 From: Ben Bolte Date: Wed, 15 Jan 2025 14:51:29 -0800 Subject: [PATCH] update env configs (#672) --- Makefile | 8 ++++++++ www/settings/configs/local.yaml | 1 + www/settings/configs/production.yaml | 1 + www/settings/configs/staging.yaml | 1 + www/settings/environment.py | 2 +- 5 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ea6f3ef6..0963e7be 100644 --- a/Makefile +++ b/Makefile @@ -22,6 +22,14 @@ create-db: $(ENV_VARS) python -m scripts.create_db --s3 --db .PHONY: create-db +create-staging-db: + ENVIRONMENT=staging python -m scripts.create_db --s3 --db +.PHONY: create-staging-db + +create-production-db: + ENVIRONMENT=production python -m scripts.create_db --s3 --db +.PHONY: create-production-db + format: @black www tests @ruff check --fix www tests diff --git a/www/settings/configs/local.yaml b/www/settings/configs/local.yaml index c4979c80..5a90871e 100644 --- a/www/settings/configs/local.yaml +++ b/www/settings/configs/local.yaml @@ -1,3 +1,4 @@ +environment: local middleware: secret_key: test aws: diff --git a/www/settings/configs/production.yaml b/www/settings/configs/production.yaml index 52469a27..888b2e2a 100644 --- a/www/settings/configs/production.yaml +++ b/www/settings/configs/production.yaml @@ -1,3 +1,4 @@ +environment: production aws: dynamodb: deletion_protection: true diff --git a/www/settings/configs/staging.yaml b/www/settings/configs/staging.yaml index 57a6799e..fc72ec4e 100644 --- a/www/settings/configs/staging.yaml +++ b/www/settings/configs/staging.yaml @@ -1,3 +1,4 @@ +environment: staging site: homepage: https://dashboard-staging.kscale.dev artifact_base_url: https://stagingassets.kscale.dev/ diff --git a/www/settings/environment.py b/www/settings/environment.py index 98b05d8e..c7971754 100644 --- a/www/settings/environment.py +++ b/www/settings/environment.py @@ -86,4 +86,4 @@ class EnvironmentSettings: aws: AwsSettings = field(default_factory=AwsSettings) site: SiteSettings = field(default_factory=SiteSettings) debug: bool = field(default=False) - environment: str = field(default="local") + environment: str = field(default=MISSING)