From 6286625d78d3e8eede126a84c0878f0b2e5ec4fe Mon Sep 17 00:00:00 2001 From: Leo Date: Sun, 1 Sep 2024 13:55:58 +0200 Subject: [PATCH] use sentry release name from SENTRY_RELEASE env var --- .github/workflows/fly.yml | 3 ++- Dockerfile | 4 ++-- app/entry.client.tsx | 2 -- app/entry.server.tsx | 1 - env.d.ts | 1 + vite.config.mjs | 1 - 6 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/fly.yml b/.github/workflows/fly.yml index a0a5deeb..0155b9b0 100644 --- a/.github/workflows/fly.yml +++ b/.github/workflows/fly.yml @@ -15,7 +15,8 @@ jobs: steps: - uses: actions/checkout@v3 - uses: superfly/flyctl-actions/setup-flyctl@master - - run: flyctl deploy --config ./fly.toml --remote-only --build-arg SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }} --build-arg BUILD_NUMBER=${{ github.run_number }} + - run: flyctl deploy --config ./fly.toml --remote-only --build-arg SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }} --build-arg SENTRY_RELEASE=${{ github.run_number }} env: FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} + SENTRY_RELEASE: ${{ github.run_number }} BUILD_NUMBER: ${{ github.run_number }} diff --git a/Dockerfile b/Dockerfile index f9513e36..094f7664 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,8 +15,8 @@ RUN pnpm install --prod false --frozen-lockfile # we'll need the sentry auth token to upload sourcemaps during the build ARG SENTRY_AUTH_TOKEN ENV SENTRY_AUTH_TOKEN=${SENTRY_AUTH_TOKEN} -ARG RELEASE_NAME -ENV RELEASE_NAME=${RELEASE_NAME} +ARG SENTRY_RELEASE +ENV SENTRY_RELEASE=${SENTRY_RELEASE} # we need those certificates to be able to connect to sentry RUN apt-get update && apt-get install -y ca-certificates diff --git a/app/entry.client.tsx b/app/entry.client.tsx index 6bb455c0..85731d52 100644 --- a/app/entry.client.tsx +++ b/app/entry.client.tsx @@ -24,8 +24,6 @@ Sentry.init({ }), Sentry.replayIntegration(), ], - - release: environment().BUILD_NUMBER, }); async function hydrate() { diff --git a/app/entry.server.tsx b/app/entry.server.tsx index 4a8063c1..77b1719c 100644 --- a/app/entry.server.tsx +++ b/app/entry.server.tsx @@ -22,7 +22,6 @@ export function handleError(error: any, { request }: { request: Request }) { Sentry.init({ dsn: process.env.SENTRY_DSN, tracesSampleRate: 1, - release: process.env.BUILD_NUMBER, }); const ABORT_DELAY = 5000; diff --git a/env.d.ts b/env.d.ts index 29f00f2d..4181179b 100644 --- a/env.d.ts +++ b/env.d.ts @@ -64,6 +64,7 @@ declare global { CDN_CGI_IMAGE_URL: string; MAILCHIMP_SIGNUP_URL: string; SENTRY_DSN: string; + SENTRY_RELEASE: string; BUILD_NUMBER: string; } interface Window { diff --git a/vite.config.mjs b/vite.config.mjs index e608104e..7432be4b 100644 --- a/vite.config.mjs +++ b/vite.config.mjs @@ -26,7 +26,6 @@ export default defineConfig({ org: "leo-hilsheimer", project: "kino-im-blauen-salon", authToken: process.env.SENTRY_AUTH_TOKEN, - release: process.env.BUILD_NUMBER, }), ], ssr: {