generated from BuildForSDG/python-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloudbuild.yaml
27 lines (27 loc) · 959 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
steps:
# Build the container image
- name: "gcr.io/cloud-builders/docker"
args: ["build", "-t", "gcr.io/$PROJECT_ID/smefinancing-api:0.1", "."]
# Push the container image to Container Registry
- name: "gcr.io/cloud-builders/docker"
args: ["push", "gcr.io/$PROJECT_ID/smefinancing-api:0.1"]
# Deploy container image to Cloud Run
- name: "gcr.io/cloud-builders/gcloud"
args:
[
"run",
"deploy",
"smefinancing-api-service",
"--image",
"gcr.io/$PROJECT_ID/smefinancing-api:0.1",
"--region",
"us-central1",
"--platform",
"managed",
"--add-cloudsql-instances",
"${_CLOUD_SQL_CONN_NAME}",
"--set-env-vars",
"CLOUD_SQL_CONN_NAME=${_CLOUD_SQL_CONN_NAME},DB_NAME=${_DB_NAME},DB_USER=${_DB_USER},DB_PASS=${_DB_PASS},FLASK_ENV=${_FLASK_ENV}",
"--allow-unauthenticated",
]
images: ["gcr.io/$PROJECT_ID/smefinancing-api:0.1"]