-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcloudbuild.yaml
57 lines (50 loc) · 2.11 KB
/
cloudbuild.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
steps:
# build the container image
- name: "gcr.io/cloud-builders/docker"
args: ["build", "-t", "us-central1-docker.pkg.dev/dreamboothy/registry-backend/registry-backend-image:$SHORT_SHA", "."]
# push container image
- name: "gcr.io/cloud-builders/docker"
args: ["push", "us-central1-docker.pkg.dev/dreamboothy/registry-backend/registry-backend-image:$SHORT_SHA"]
# Clone the GitHub repository
- name: "gcr.io/cloud-builders/git"
args: [ "clone", "https://github.com/Comfy-Org/registry-backend.git", "registry-backend" ]
dir: "/workspace"
# Run database migrations for staging
- name: "gcr.io/google.com/cloudsdktool/cloud-sdk"
entrypoint: "bash"
args:
- "-c"
- |
curl -sSL https://atlasgo.sh | sh
atlas migrate apply --dir "file://ent/migrate/migrations" --url $$STAGING_DB_CONNECTION_STRING
secretEnv: ['STAGING_DB_CONNECTION_STRING']
dir: "/workspace/registry-backend"
# Run database migrations for prod
- name: "gcr.io/google.com/cloudsdktool/cloud-sdk"
entrypoint: "bash"
args:
- "-c"
- |
curl -sSL https://atlasgo.sh | sh
atlas migrate apply --dir "file://ent/migrate/migrations" --url $$PROD_SUPABASE_CONNECTION_STRING
secretEnv: [ 'PROD_SUPABASE_CONNECTION_STRING' ]
dir: "/workspace/registry-backend"
# Publish the release
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk:458.0.1'
entrypoint: 'bash'
args:
- '-c'
- >
gcloud deploy releases create release-registry-backend-$SHORT_SHA
--project=dreamboothy
--region=us-central1
--delivery-pipeline=comfy-backend-api-pipeline
--images=registry-backend-image-substitute=us-central1-docker.pkg.dev/dreamboothy/registry-backend/registry-backend-image:$SHORT_SHA
availableSecrets:
secretManager:
- versionName: projects/357148958219/secrets/STAGING_SUPABASE_CONNECTION_STRING/versions/latest
env: 'STAGING_DB_CONNECTION_STRING'
- versionName: projects/357148958219/secrets/PROD_SUPABASE_CONNECTION_STRING/versions/latest
env: 'PROD_SUPABASE_CONNECTION_STRING'
options:
machineType: 'E2_HIGHCPU_8'