-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcloudbuild.yaml
More file actions
74 lines (66 loc) · 1.93 KB
/
Copy pathcloudbuild.yaml
File metadata and controls
74 lines (66 loc) · 1.93 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
steps:
# Build Backend Container
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'gcr.io/$PROJECT_ID/verify-backend', './backend']
id: 'build-backend'
timeout: '1200s'
# Build Frontend Container
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'gcr.io/$PROJECT_ID/verify-frontend', '.']
id: 'build-frontend'
timeout: '600s'
# Push Backend Image
- name: 'gcr.io/cloud-builders/docker'
args: ['push', 'gcr.io/$PROJECT_ID/verify-backend']
id: 'push-backend'
waitFor: ['build-backend']
# Push Frontend Image
- name: 'gcr.io/cloud-builders/docker'
args: ['push', 'gcr.io/$PROJECT_ID/verify-frontend']
id: 'push-frontend'
waitFor: ['build-frontend']
# Deploy Backend to Cloud Run
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
entrypoint: gcloud
args:
- 'run'
- 'deploy'
- 'verify-backend'
- '--image=gcr.io/$PROJECT_ID/verify-backend'
- '--region=us-central1'
- '--platform=managed'
- '--allow-unauthenticated'
- '--memory=4Gi'
- '--cpu=2'
- '--timeout=300'
- '--max-instances=10'
- '--min-instances=1'
id: 'deploy-backend'
waitFor: ['push-backend']
# Deploy Frontend to Cloud Run
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
entrypoint: gcloud
args:
- 'run'
- 'deploy'
- 'verify-frontend'
- '--image=gcr.io/$PROJECT_ID/verify-frontend'
- '--region=us-central1'
- '--platform=managed'
- '--allow-unauthenticated'
- '--memory=512Mi'
- '--cpu=1'
- '--max-instances=5'
- '--min-instances=0'
id: 'deploy-frontend'
waitFor: ['push-frontend']
# Images to be pushed to Container Registry
images:
- 'gcr.io/$PROJECT_ID/verify-backend'
- 'gcr.io/$PROJECT_ID/verify-frontend'
# Build timeout
timeout: '2400s'
# Options
options:
machineType: 'N1_HIGHCPU_8'
logging: CLOUD_LOGGING_ONLY