From 43256608a8e56ca4b2d8e502960c25d0b085e2d1 Mon Sep 17 00:00:00 2001 From: Kichiyaki Date: Sat, 6 Nov 2021 08:10:53 +0100 Subject: [PATCH] Sentry release is now configurable --- .github/workflows/publish.yml | 1 + Dockerfile | 4 ++++ next.config.js | 5 ++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index fce379a..b0c46c2 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -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 }} diff --git a/Dockerfile b/Dockerfile index 9a39f02..afa3477 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 ./ diff --git a/next.config.js b/next.config.js index ec9aee2..82947c6 100644 --- a/next.config.js +++ b/next.config.js @@ -35,4 +35,7 @@ const cfg = { }, }; -module.exports = withSentryConfig(cfg, { silent: true }); +module.exports = withSentryConfig(cfg, { + silent: true, + release: process.env.NEXT_PUBLIC_VERSION, +});