-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: readiness return version info, sentry get git commit hash (#479)
* build: remove github review workflow files * fix: settings set COMMIT_HASH to empty by default * fix: url.py import JsonResponse
- Loading branch information
1 parent
44ae39a
commit fce8d90
Showing
6 changed files
with
22 additions
and
109 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__version__ = "1.13.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
import os | ||
import subprocess | ||
from datetime import datetime | ||
from sys import stdout | ||
|
||
import environ | ||
import sentry_sdk | ||
from sentry_sdk.integrations.django import DjangoIntegration | ||
|
||
from open_city_profile import __version__ | ||
|
||
checkout_dir = environ.Path(__file__) - 2 | ||
assert os.path.exists(checkout_dir("manage.py")) | ||
|
||
|
@@ -43,7 +45,7 @@ | |
DEFAULT_FROM_EMAIL=(str, "[email protected]"), | ||
FIELD_ENCRYPTION_KEYS=(list, []), | ||
SALT_NATIONAL_IDENTIFICATION_NUMBER=(str, None), | ||
VERSION=(str, None), | ||
OPENSHIFT_BUILD_COMMIT=(str, ""), | ||
AUDIT_LOG_TO_LOGGER_ENABLED=(bool, False), | ||
AUDIT_LOG_LOGGER_FILENAME=(str, ""), | ||
AUDIT_LOG_TO_DB_ENABLED=(bool, False), | ||
|
@@ -72,18 +74,11 @@ | |
if os.path.exists(env_file): | ||
env.read_env(env_file) | ||
|
||
VERSION = env.str("VERSION") | ||
if VERSION is None: | ||
try: | ||
VERSION = subprocess.check_output( | ||
["git", "describe", "--always"], text=True | ||
).strip() | ||
except (FileNotFoundError, subprocess.CalledProcessError): | ||
VERSION = None | ||
|
||
COMMIT_HASH = env.str("OPENSHIFT_BUILD_COMMIT", "") | ||
VERSION = __version__ | ||
sentry_sdk.init( | ||
dsn=env.str("SENTRY_DSN", ""), | ||
release=VERSION, | ||
release=env.str("OPENSHIFT_BUILD_COMMIT", VERSION), | ||
environment=env.str("SENTRY_ENVIRONMENT", "development"), | ||
integrations=[DjangoIntegration()], | ||
) | ||
|
@@ -390,3 +385,6 @@ | |
KEYCLOAK_CLIENT_SECRET = env("KEYCLOAK_CLIENT_SECRET") | ||
KEYCLOAK_GDPR_CLIENT_ID = env("KEYCLOAK_GDPR_CLIENT_ID") | ||
KEYCLOAK_GDPR_CLIENT_SECRET = env("KEYCLOAK_GDPR_CLIENT_SECRET") | ||
|
||
# get build time from a file in docker image | ||
APP_BUILD_TIME = datetime.fromtimestamp(os.path.getmtime(__file__)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters