diff --git a/Dockerfile b/Dockerfile index cb3f32d8..e765d76c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -149,3 +149,6 @@ RUN npm run build:prod # Our entrypoint runs as root USER root + +ARG GIT_COMMIT_SHA +ENV GIT_SHA ${GIT_COMMIT_SHA} diff --git a/consul_config.py.ctmpl b/consul_config.py.ctmpl index cd0afaf6..65586631 100644 --- a/consul_config.py.ctmpl +++ b/consul_config.py.ctmpl @@ -40,9 +40,10 @@ MUSICBRAINZ_CLIENT_SECRET = '''{{template "KEY" "musicbrainz/client_secret"}}''' COMPILE_LESS = False LOG_SENTRY = { - 'dsn':'''{{template "KEY" "sentry_dsn"}}''', - 'environment': 'production', + 'dsn':'''{{template "KEY" "sentry/dsn"}}''', + 'environment': '''{{template "KEY" "sentry/environment"}}''', 'level': 'WARN', + 'release': os.getenv('GIT_SHA', None), } DATASET_DIR = '''{{template "KEY" "dataset_dir"}}''' diff --git a/docker/push.sh b/docker/push.sh index 45128f15..b6758d1c 100755 --- a/docker/push.sh +++ b/docker/push.sh @@ -19,7 +19,8 @@ TAG=${2:-beta} echo "Building AcousticBrainz web image with env $ENV tag $TAG..." docker build -t metabrainz/acousticbrainz:$TAG \ - --target acousticbrainz-prod . + --target acousticbrainz-prod \ + --build-arg GIT_COMMIT_SHA=$(git describe --tags --dirty --always) . echo "Done!" echo "Pushing image to docker hub metabrainz/acousticbrainz-web:$TAG..." docker push metabrainz/acousticbrainz:$TAG