Skip to content

Commit

Permalink
Check if auth token works as an env variable without file
Browse files Browse the repository at this point in the history
  • Loading branch information
obulat committed Dec 18, 2024
1 parent c7f5b78 commit 0752b91
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ jobs:
uses: docker/build-push-action@v6
with:
secrets: |
"sentry_auth_token=${{ matrix.image == 'frontend' && secrets.SENTRY_AUTH_TOKEN }}"
"sentry_auth_token=${{ secrets.SENTRY_AUTH_TOKEN }}"
context: ${{ matrix.context }}
target: ${{ matrix.target }}
push: false
Expand Down
9 changes: 5 additions & 4 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,15 @@ ENV SEMANTIC_VERSION=${SEMANTIC_VERSION}
ENV ADD_SENTRY_RELEASE=${ADD_SENTRY_RELEASE}

RUN --mount=type=secret,id=sentry_auth_token,mode=0444 \
sh -c 'if [ "$ADD_SENTRY_RELEASE" = "true" ]; then \
SENTRY_AUTH_TOKEN="$(cat /run/secrets/sentry_auth_token)" && \
echo "SENTRY_AUTH_TOKEN=$SENTRY_AUTH_TOKEN" >> .env.sentry-build-plugin; \
fi' && printenv
sh -c 'SENTRY_AUTH_TOKEN="$(cat /run/secrets/sentry_auth_token)"; \
echo "SENTRY_AUTH_TOKEN=$SENTRY_AUTH_TOKEN"; \
export SENTRY_AUTH_TOKEN; \
' && printenv

RUN echo add sentry release: "$ADD_SENTRY_RELEASE" && echo semantic version: "$SEMANTIC_VERSION" && echo sentry auth token: "$SENTRY_AUTH_TOKEN"

RUN pnpm build

############
# Nuxt app #
############
Expand Down

0 comments on commit 0752b91

Please sign in to comment.