Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

James fix build 2 #6

Merged
merged 1 commit into from
May 26, 2024
Merged
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
23 changes: 5 additions & 18 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,17 @@ steps:
- name: "gcr.io/cloud-builders/docker"
args: ["push", "us-central1-docker.pkg.dev/dreamboothy/registry-backend/registry-backend-image:$SHORT_SHA"]

# Fetch the database connection string secret for staging
# Fetch the secret and set environment variable for staging
- name: "gcr.io/google.com/cloudsdktool/cloud-sdk"
entrypoint: "bash"
args:
- "-c"
- |
STAGING_SUPABASE_CONNECTION_STRING=$(gcloud secrets versions access latest --secret="STAGING_SUPABASE_CONNECTION_STRING")
export STAGING_SUPABASE_CONNECTION_STRING=$STAGING_SUPABASE_CONNECTION_STRING

# Install Atlas
- name: 'gcr.io/cloud-builders/curl'
entrypoint: 'sh'
args:
- '-c'
- |
export STAGING_DB_CONNECTION_STRING=$(gcloud secrets versions access latest --secret=STAGING_DB_CONNECTION_STRING)

# Run database migrations for staging
curl -sSL https://atlasgo.sh | sh

# Run database migrations on staging environment
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk:latest'
entrypoint: 'bash'
args:
- '-c'
- |
atlas migrate apply --dir "ent/migrate/migrations" --url "$STAGING_SUPABASE_CONNECTION_STRING"
atlas migrate apply --dir "file://ent/migrate/migrations" --url "$STAGING_DB_CONNECTION_STRING"

# Publish the release
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk:458.0.1'
Expand Down
Loading