-
Notifications
You must be signed in to change notification settings - Fork 1
/
cloudbuild.yaml
53 lines (50 loc) · 1.37 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
steps:
# Build the container image
- name: "gcr.io/cloud-builders/docker"
args:
[
"build",
"--tag",
"gcr.io/$_PROJECT_ID/uspy:$COMMIT_SHA",
"-f",
"docker/app/Dockerfile",
".",
]
dir: .
# Push the container image to Container Registry
- name: "gcr.io/cloud-builders/docker"
args: ["push", "gcr.io/$_PROJECT_ID/uspy:$COMMIT_SHA"]
# Deploy image to Cloud Run
- name: "gcr.io/cloud-builders/gcloud"
args: [
"run",
"deploy",
"uspy-backend",
"--image=gcr.io/$_PROJECT_ID/uspy:$COMMIT_SHA",
"--region=us-east1",
"--platform=managed",
"--max-instances=5",
"--service-account=$_SERVICE_ACCOUNT",
"--set-env-vars=\
USPY_DOMAIN=$_DOMAIN,\
USPY_MODE=$_MODE,\
USPY_PROJECT_ID=$_PROJECT_ID,\
USPY_JWT_SECRET=$_JWT_SECRET,\
USPY_RATE_LIMIT=$_RATE_LIMIT,\
USPY_AES_KEY=$_AES_KEY,\
USPY_MAILJET_KEY=$_MAILJET_KEY,\
USPY_MAILJET_SECRET=$_MAILJET_SECRET,\
USPY_AUTH_ENDPOINT=$_AUTH_ENDPOINT",
]
# Assign 100% of the traffic to the latest version
- name: "gcr.io/cloud-builders/gcloud"
args:
[
"run",
"services",
"update-traffic",
"uspy-backend",
"--region=us-east1",
"--platform=managed",
"--to-latest",
]