Skip to content

Commit

Permalink
Read sentry environment from consul, use docker build arg to set release
Browse files Browse the repository at this point in the history
  • Loading branch information
alastair committed Mar 31, 2021
1 parent 553504d commit d63ec97
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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}
5 changes: 3 additions & 2 deletions consul_config.py.ctmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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"}}'''
Expand Down
3 changes: 2 additions & 1 deletion docker/push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d63ec97

Please sign in to comment.