Skip to content

Commit

Permalink
Fix logic to fetch secret in cloudbuily.yaml file (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
james03160927 authored May 26, 2024
1 parent 3cb6bea commit 7e34672
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ steps:
- name: "gcr.io/cloud-builders/docker"
args: ["push", "us-central1-docker.pkg.dev/dreamboothy/registry-backend/registry-backend-image:$SHORT_SHA"]

# Fetch the secret and set environment variable for staging
# Step 3: Fetch the secret and run database migrations for staging
- name: "gcr.io/google.com/cloudsdktool/cloud-sdk"
entrypoint: "bash"
args:
- "-c"
- |
export STAGING_DB_CONNECTION_STRING=$(gcloud secrets versions access latest --secret=STAGING_DB_CONNECTION_STRING)
# Run database migrations for staging
STAGING_DB_CONNECTION_STRING=$(gcloud secrets versions access latest --secret=STAGING_DB_CONNECTION_STRING)
curl -sSL https://atlasgo.sh | sh
atlas migrate apply --dir "file://ent/migrate/migrations" --url "$STAGING_DB_CONNECTION_STRING"
Expand Down

0 comments on commit 7e34672

Please sign in to comment.