Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions other/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,21 @@ RUN npm prune --omit=dev
# Build the app
FROM base as build

# The Sentry bundler plugin shells out to a native `sentry-cli` binary, and that
# binary — unlike Node — verifies TLS against the system trust store. The slim
# base image has no CA bundle at all:
#
# $ docker run --rm node:22.23.3-bookworm-slim ls /etc/ssl/certs/ca-certificates.crt
# ls: cannot access '/etc/ssl/certs/ca-certificates.crt': No such file or directory
#
# So `npm install` succeeds (Node bundles its own roots) and then every release
# and source-map upload fails with "SSL certificate problem: unable to get local
# issuer certificate". This only ever surfaces once #16 makes the plugin reach
# the API at all; before that the `org` guard returned before any network call.
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates \
&& rm -rf /var/lib/apt/lists/*

ARG COMMIT_SHA
ENV COMMIT_SHA=$COMMIT_SHA

Expand Down
10 changes: 10 additions & 0 deletions tests/sentry-release.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,16 @@ describe('Sentry release management build inputs', () => {
expect(dockerfile).toMatch(/^ENV COMMIT_SHA=\$COMMIT_SHA$/m)
})

it('installs a CA bundle, or the Sentry CLI cannot verify TLS', () => {
// `@sentry/vite-plugin` shells out to a native `sentry-cli`, which checks
// TLS against the system trust store rather than Node's bundled roots.
// `node:22.23.3-bookworm-slim` ships no CA bundle, so without this the
// first real upload fails with "unable to get local issuer certificate" —
// which is only reachable now that the plugin gets far enough to make a
// request. See #16.
expect(buildStage()).toMatch(/apt-get install[^\n]*ca-certificates/)
})

it('backs each build secret with a value in the step env', () => {
// The deploy step passes each secret as `--build-secret "NAME=$NAME"`, so
// the value is a shell expansion. If the `env:` entry behind it were
Expand Down
Loading