Sentry release is now configurable

This commit is contained in:
Dawid Wysokiński 2021-11-06 08:10:53 +01:00
parent a5682b0897
commit 43256608a8
Signed by: Kichiyaki
GPG Key ID: EF14026D247EB867
3 changed files with 9 additions and 1 deletions

View File

@ -45,6 +45,7 @@ jobs:
SENTRY_PROJECT=${{ secrets.SENTRY_PROJECT }}
SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_DSN=${{ secrets.SENTRY_DSN }}
VERSION=v${{ steps.get_version.outputs.VERSION }}
tags: |
${{ secrets.REGISTRY_NAME }}/zdam-egzamin-zawodowy-website:latest
${{ secrets.REGISTRY_NAME }}/zdam-egzamin-zawodowy-website:${{ steps.get_version.outputs.VERSION }}

View File

@ -9,6 +9,7 @@ RUN yarn install --frozen-lockfile
# Rebuild the source code only when needed
FROM node:14.18.1-alpine AS builder
ARG VERSION="v0.0.0"
ARG ENABLE_SENTRY_WEBPACK_PLUGIN="false"
ARG SENTRY_URL=""
ARG SENTRY_ORG=""
@ -25,6 +26,7 @@ ENV ENABLE_SENTRY_WEBPACK_PLUGIN=$ENABLE_SENTRY_WEBPACK_PLUGIN \
SENTRY_AUTH_TOKEN=$SENTRY_AUTH_TOKEN \
SENTRY_DSN=$SENTRY_DSN \
NEXT_PUBLIC_SENTRY_DSN=$SENTRY_DSN \
NEXT_PUBLIC_VERSION=$VERSION \
BUILDING_PROCESS=true
COPY . .
@ -37,11 +39,13 @@ FROM node:14.18.1-alpine AS runner
WORKDIR /app
ARG VERSION="v0.0.0"
ARG SENTRY_DSN=""
ENV NODE_ENV=production \
SENTRY_DSN=$SENTRY_DSN \
NEXT_PUBLIC_SENTRY_DSN=$SENTRY_DSN \
VERSION=$VERSION \
BUILDING_PROCESS=false
COPY --from=builder /app/next.config.js ./

View File

@ -35,4 +35,7 @@ const cfg = {
},
};
module.exports = withSentryConfig(cfg, { silent: true });
module.exports = withSentryConfig(cfg, {
silent: true,
release: process.env.NEXT_PUBLIC_VERSION,
});