-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcloudbuild.yaml
31 lines (26 loc) · 947 Bytes
/
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
options:
logging: CLOUD_LOGGING_ONLY
steps:
# Step 1: Build the container image
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'gcr.io/cs6220userconversion/user-conversion-api', '.']
# Step 2: Push the container image to Container Registry
- name: 'gcr.io/cloud-builders/docker'
args: ['push', 'gcr.io/cs6220userconversion/user-conversion-api']
# Step 3: Deploy the image to Cloud Run
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
entrypoint: gcloud
args:
- 'run'
- 'deploy'
- 'user-conversion-api'
- '--image'
- 'gcr.io/cs6220userconversion/user-conversion-api'
- '--region'
- '$_REGION' # Dynamic region substitution
- '--platform'
- 'managed'
- '--allow-unauthenticated' # Allows public access; adjust as needed
substitutions:
_REGION: 'us-east1' # Default region for deployment
timeout: '1200s' # Set timeout to 20 minutes