fix(deploy): resolve Sentry sourcemap upload release name via git SHA build arg
.git is excluded from the Docker build context (.dockerignore), so @sentry/nextjs can't auto-detect a release via git and falls back to the literal string "undefined" for --release, which made the sourcemaps upload command fail with exit code 1 (confirmed via verbose build log). start.sh now resolves the short SHA on the host and passes it through as a SENTRY_RELEASE build arg, same pattern as the other Sentry vars.
This commit is contained in:
1 parent
53789ca56e
commit
6980b09e45
3 files changed
+13
No files matched your search
@@ -29,6 +29,7 @@ ARG NEXT_PUBLIC_SENTRY_DSN
|
||||
ARG SENTRY_ORG
|
||||
ARG SENTRY_PROJECT
|
||||
ARG SENTRY_AUTH_TOKEN
|
||||
ARG SENTRY_RELEASE
|
||||
|
||||
ENV NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=$NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY
|
||||
ENV NEXT_PUBLIC_SUPABASE_URL=$NEXT_PUBLIC_SUPABASE_URL
|
||||
@@ -36,6 +37,7 @@ ENV NEXT_PUBLIC_SENTRY_DSN=$NEXT_PUBLIC_SENTRY_DSN
|
||||
ENV SENTRY_ORG=$SENTRY_ORG
|
||||
ENV SENTRY_PROJECT=$SENTRY_PROJECT
|
||||
ENV SENTRY_AUTH_TOKEN=$SENTRY_AUTH_TOKEN
|
||||
ENV SENTRY_RELEASE=$SENTRY_RELEASE
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
|
||||
RUN npx prisma generate
|
||||
|
||||
@@ -24,6 +24,12 @@ services:
|
||||
SENTRY_ORG: ${SENTRY_ORG}
|
||||
SENTRY_PROJECT: ${SENTRY_PROJECT}
|
||||
SENTRY_AUTH_TOKEN: ${SENTRY_AUTH_TOKEN}
|
||||
# Resolves the sourcemap upload's release name. .git is excluded from
|
||||
# the build context (see .dockerignore), so @sentry/nextjs can't
|
||||
# auto-detect it via git and falls back to a literal "undefined"
|
||||
# string, which GlitchTip's sourcemaps upload rejects. start.sh sets
|
||||
# this from `git rev-parse --short HEAD` on the host before building.
|
||||
SENTRY_RELEASE: ${SENTRY_RELEASE}
|
||||
image: pawfeed:latest
|
||||
container_name: pawfeed
|
||||
restart: unless-stopped
|
||||
|
||||
@@ -11,5 +11,10 @@ if [ ! -f .env ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Sentry/GlitchTip sourcemap upload needs a release name at build time.
|
||||
# .git is excluded from the Docker build context, so it's resolved here
|
||||
# on the host (where .git exists) and passed through as a build arg.
|
||||
export SENTRY_RELEASE="$(git -C .. rev-parse --short HEAD)"
|
||||
|
||||
docker compose up -d --build
|
||||
echo "PawFeed is starting on http://localhost:4563"
|
||||
Reference in new issue
Block a user