From 40d14391024351b475664a4cce5fcf9d4d212825 Mon Sep 17 00:00:00 2001 From: Olga Bulat Date: Tue, 17 Dec 2024 21:33:40 +0300 Subject: [PATCH] Use unstable_sentryBundlerPluginOptions --- frontend/Dockerfile | 2 ++ frontend/nuxt.config.ts | 5 +++++ frontend/sentry.server.config.ts | 7 +++++++ 3 files changed, 14 insertions(+) diff --git a/frontend/Dockerfile b/frontend/Dockerfile index a2d6a9d7e34..e190ff0b2c5 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -47,6 +47,8 @@ ENV NODE_ENV=production ENV NODE_OPTIONS="--max_old_space_size=4096" ENV SEMANTIC_VERSION=${SEMANTIC_VERSION} +RUN printenv + RUN --mount=type=secret,id=sentry_auth_token \ sh -c "export SENTRY_AUTH_TOKEN=$(cat /run/secrets/sentry_auth_token) && pnpm build" diff --git a/frontend/nuxt.config.ts b/frontend/nuxt.config.ts index e8ef52fb170..c201d4e887c 100644 --- a/frontend/nuxt.config.ts +++ b/frontend/nuxt.config.ts @@ -132,6 +132,11 @@ export default defineNuxtConfig({ org: "openverse", project: "openverse-frontend", }, + unstable_sentryBundlerPluginOptions: { + release: { + name: import.meta.env.SEMANTIC_VERSION, + }, + }, }, sourcemap: { client: "hidden", diff --git a/frontend/sentry.server.config.ts b/frontend/sentry.server.config.ts index d356f895cc6..2d3f6e101a7 100644 --- a/frontend/sentry.server.config.ts +++ b/frontend/sentry.server.config.ts @@ -5,6 +5,13 @@ import dotenv from "dotenv" // @see the section on server setup: https://nuxt.com/modules/sentry dotenv.config() +console.log( + "Will initialize Sentry with dsn", + process.env.NUXT_PUBLIC_SENTRY_DSN +) +console.log("environment", process.env.NUXT_PUBLIC_SENTRY_ENVIRONMENT) +console.log("release", process.env.SEMANTIC_VERSION) + Sentry.init({ dsn: process.env.NUXT_PUBLIC_SENTRY_DSN, environment: process.env.NUXT_PUBLIC_SENTRY_ENVIRONMENT,