Skip to content

Commit

Permalink
add auth token
Browse files Browse the repository at this point in the history
  • Loading branch information
Lms24 committed Nov 7, 2024
1 parent 2d869a0 commit 06aeaf6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ README.md
api-node/node_modules
api-node/dist
api-node/.env
.env
4 changes: 3 additions & 1 deletion Dockerfile.nestjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ ENV \
WORKDIR /work/api-node

# Build the application
RUN yarn build:ci
RUN --mount=type=secret,id=SENTRY_AUTH_TOKEN \
export SENTRY_AUTH_TOKEN=$(cat /run/secrets/SENTRY_AUTH_TOKEN) && \
yarn build

# Set ownership
RUN chown -R registry:registry ./
Expand Down
5 changes: 5 additions & 0 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ steps:
- name: 'gcr.io/cloud-builders/docker'
args: [
'build',
"--secret", "id=SENTRY_AUTH_TOKEN,env=SENTRY_AUTH_TOKEN",
'-f', 'Dockerfile.nestjs',
'-t', 'us-central1-docker.pkg.dev/$PROJECT_ID/sentry-release-registry/image:latest',
'-t', 'us-central1-docker.pkg.dev/$PROJECT_ID/sentry-release-registry/image:$COMMIT_SHA',
Expand All @@ -25,3 +26,7 @@ steps:
images: [
'us-central1-docker.pkg.dev/$PROJECT_ID/sentry-release-registry/image:$COMMIT_SHA',
]
availableSecrets:
secretManager:
- versionName: projects/294472738882/secrets/release-registry-oauth-token
env: 'SENTRY_AUTH_TOKEN'

0 comments on commit 06aeaf6

Please sign in to comment.