Auto-inject version into image

This commit is contained in:
2024-04-21 16:52:55 +01:00
parent 123ed8aa15
commit a4007d585b
3 changed files with 14 additions and 1 deletions

View File

@ -8,6 +8,7 @@ class Config:
def __init__(self) -> None:
"""Configuration module."""
self.__environment: str = os.environ.get("APP_LIFECYCLE", "DEV").upper()
self.__version: str = os.environ["APP_VERSION"]
self.__bot_name: str = os.environ["BOT_NAME"]
self.__webex_token: str = os.environ["WEBEX_API_KEY"]
self.__admin_first_name: str = os.environ["ADMIN_FIRST_NAME"]
@ -24,6 +25,11 @@ class Config:
"""Returns the current app lifecycle."""
return self.__environment
@property
def version(self) -> str:
"""Returns the current app version."""
return self.__version
@property
def sentry_enabled(self) -> bool:
"""Returns True if Sentry SDK is enabled, else False."""