Skip to content

Commit

Permalink
fix(sentry): move to docker secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
bassrock committed Aug 16, 2024
1 parent a89e66a commit 542e39d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .github/actions/containerize/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,11 @@ runs:
GIT_SHA=${{ github.sha }}
SCOPE=${{inputs.scope}}
APP_PATH=${{inputs.app-path}}
SENTRY_AUTH_TOKEN=${{ inputs.sentry-token }}
SENTRY_ORG=${{inputs.sentry-org}}
SENTRY_PROJECT=${{inputs.sentry-project}}
PORT=${{inputs.app-port}}
secrets: |
sentry_token=${{ inputs.sentry-token }}
- name: Output Build Name
id: get-build-name
shell: bash
Expand Down
8 changes: 3 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ ARG SCOPE
ARG APP_PATH
ARG PORT
ARG GIT_SHA
ARG SENTRY_AUTH_TOKEN
ARG SENTRY_ORG
ARG SENTRY_PROJECT

Expand All @@ -36,7 +35,6 @@ ARG SCOPE
ARG APP_PATH
ARG PORT
ARG GIT_SHA
ARG SENTRY_AUTH_TOKEN
ARG SENTRY_ORG
ARG SENTRY_PROJECT

Expand All @@ -60,7 +58,6 @@ ARG SCOPE
ARG APP_PATH
ARG PORT
ARG GIT_SHA
ARG SENTRY_AUTH_TOKEN
ARG SENTRY_ORG
ARG SENTRY_PROJECT

Expand Down Expand Up @@ -95,7 +92,8 @@ RUN pnpx @sentry/cli sourcemaps inject pruned/dist
RUN mv ./.prisma.tmp pruned/node_modules/.prisma | true

# If sentry project was passed, upload the source maps
RUN if [ -n "$SENTRY_PROJECT" ] ; then pnpx @sentry/cli sourcemaps upload pruned/dist --release ${GIT_SHA} --auth-token ${SENTRY_AUTH_TOKEN} --org ${SENTRY_ORG} --project ${SENTRY_PROJECT} ; fi
RUN --mount=type=secret,id=sentry_token \
if [ -n "$SENTRY_PROJECT" ] ; then pnpx @sentry/cli sourcemaps upload pruned/dist --release ${GIT_SHA} --auth-token $(cat /run/secrets/sentry_token) --org ${SENTRY_ORG} --project ${SENTRY_PROJECT} ; fi

#----------------------------------------
# Docker build step that:
Expand All @@ -118,7 +116,7 @@ RUN chown -R nodejs:nodejs /app
USER nodejs

ENV NODE_ENV=production
ENV PORT $PORT
ENV PORT=${PORT}
ENV GIT_SHA=${GIT_SHA}
ENV RELEASE_SHA=${GIT_SHA}

Expand Down

0 comments on commit 542e39d

Please sign in to comment.