VBV-381: rename app env variable to VITE_APP_ENVIRONMENT

This commit is contained in:
Daniel Egger 2023-06-01 21:55:56 +02:00
parent 800a07ba7e
commit fb74ffeeb2
18 changed files with 12 additions and 14 deletions

View File

@ -26,7 +26,7 @@ See `.tool-versions` file for used django and node version
You have to set up at least the following environment variables: You have to set up at least the following environment variables:
```bash ```bash
export IT_APP_ENVIRONMENT=local export VITE_APP_ENVIRONMENT=local
``` ```
See `.env_secrets/local_daniel.env` for more possible environment variables. See `.env_secrets/local_daniel.env` for more possible environment variables.

View File

@ -73,7 +73,7 @@ def main(app_name, image_name, environment_file):
container_http_port=7555, container_http_port=7555,
environment_variables={ environment_variables={
# 'DJANGO_SETTINGS_MODULE': 'config.settings.base', # 'DJANGO_SETTINGS_MODULE': 'config.settings.base',
"IT_APP_ENVIRONMENT": env.str("IT_APP_ENVIRONMENT", "dev-feature"), "VITE_APP_ENVIRONMENT": env.str("VITE_APP_ENVIRONMENT", "dev-feature"),
"IT_DEFAULT_ADMIN_PASSWORD": env.str("fWwoQzreIS5uztLOyF8jJpS9M"), "IT_DEFAULT_ADMIN_PASSWORD": env.str("fWwoQzreIS5uztLOyF8jJpS9M"),
"POSTGRES_HOST": f"srv-captain--{app_name}-postgres", "POSTGRES_HOST": f"srv-captain--{app_name}-postgres",
"POSTGRES_PORT": 5432, "POSTGRES_PORT": 5432,

View File

@ -13,7 +13,7 @@ export PATH="$PWD/vbvvenv/bin:$PATH"
docker login --username=iterativ --password=$DOCKER_PASSWORD_TOKEN docker login --username=iterativ --password=$DOCKER_PASSWORD_TOKEN
# only used for `python manage.py collectstatic` so value doesn't matter # only used for `python manage.py collectstatic` so value doesn't matter
export IT_APP_ENVIRONMENT=dev export VITE_APP_ENVIRONMENT=dev
pip install -r $BITBUCKET_CLONE_DIR/server/requirements/requirements-dev.txt pip install -r $BITBUCKET_CLONE_DIR/server/requirements/requirements-dev.txt

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1 +1 @@
export IT_APP_ENVIRONMENT=local export VITE_APP_ENVIRONMENT=local

View File

@ -3,7 +3,7 @@
# set location to script directory # set location to script directory
cd "${0%/*}" cd "${0%/*}"
export IT_APP_ENVIRONMENT=local export VITE_APP_ENVIRONMENT=local
export DJANGO_SETTINGS_MODULE=config.settings.test_cypress export DJANGO_SETTINGS_MODULE=config.settings.test_cypress
export DJANGO_PORT=8001 export DJANGO_PORT=8001
export PGDATABASE=vbv_lernwelt_cypress export PGDATABASE=vbv_lernwelt_cypress

View File

@ -7,7 +7,7 @@ import django
sys.path.append("../server") sys.path.append("../server")
os.environ.setdefault("IT_APP_ENVIRONMENT", "local") os.environ.setdefault("VITE_APP_ENVIRONMENT", "local")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.base") os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.base")
django.setup() django.setup()

View File

@ -15,7 +15,7 @@ env = Env()
env.read_env() env.read_env()
# set to "local" for local development # set to "local" for local development
APP_ENVIRONMENT = env("IT_APP_ENVIRONMENT") APP_ENVIRONMENT = env("VITE_APP_ENVIRONMENT")
# GENERAL # GENERAL
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
@ -619,7 +619,7 @@ if FILE_UPLOAD_STORAGE == "s3":
AWS_PRESIGNED_EXPIRY = env.int("AWS_PRESIGNED_EXPIRY", default=300) # seconds AWS_PRESIGNED_EXPIRY = env.int("AWS_PRESIGNED_EXPIRY", default=300) # seconds
if APP_ENVIRONMENT.startswith("dev"): if APP_ENVIRONMENT == "local":
# http://whitenoise.evans.io/en/latest/django.html#using-whitenoise-in-development # http://whitenoise.evans.io/en/latest/django.html#using-whitenoise-in-development
INSTALLED_APPS = ["whitenoise.runserver_nostatic"] + INSTALLED_APPS # noqa F405 INSTALLED_APPS = ["whitenoise.runserver_nostatic"] + INSTALLED_APPS # noqa F405
@ -652,10 +652,8 @@ if APP_ENVIRONMENT.startswith("dev"):
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# https://django-extensions.readthedocs.io/en/latest/installation_instructions.html#configuration # https://django-extensions.readthedocs.io/en/latest/installation_instructions.html#configuration
INSTALLED_APPS += ["django_extensions", "django_watchfiles"] # noqa F405 INSTALLED_APPS += ["django_extensions", "django_watchfiles"] # noqa F405
else:
if APP_ENVIRONMENT in ["production", "caprover"] or APP_ENVIRONMENT.startswith( # not local
"caprover"
):
# SECURITY # SECURITY
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#secure-proxy-ssl-header # https://docs.djangoproject.com/en/dev/ref/settings/#secure-proxy-ssl-header

View File

@ -1,7 +1,7 @@
# pylint: disable=unused-wildcard-import,wildcard-import,wrong-import-position # pylint: disable=unused-wildcard-import,wildcard-import,wrong-import-position
import os import os
os.environ["IT_APP_ENVIRONMENT"] = "local" os.environ["VITE_APP_ENVIRONMENT"] = "local"
from .base import * # noqa from .base import * # noqa

View File

@ -1,7 +1,7 @@
# pylint: disable=unused-wildcard-import,wildcard-import,wrong-import-position # pylint: disable=unused-wildcard-import,wildcard-import,wrong-import-position
import os import os
os.environ["IT_APP_ENVIRONMENT"] = "local" os.environ["VITE_APP_ENVIRONMENT"] = "local"
from .base import * # noqa from .base import * # noqa