-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcloudbuild.yaml
More file actions
58 lines (53 loc) · 1.35 KB
/
cloudbuild.yaml
File metadata and controls
58 lines (53 loc) · 1.35 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
steps:
- name: 'gcr.io/cloud-builders/docker'
id: 'build'
args:
- 'build'
- '-t'
- '${_REGION}-docker.pkg.dev/${PROJECT_ID}/${_REPOSITORY}/matrixcalc:$COMMIT_SHA'
- '-t'
- '${_REGION}-docker.pkg.dev/${PROJECT_ID}/${_REPOSITORY}/matrixcalc:latest'
- '.'
- name: 'gcr.io/cloud-builders/docker'
id: 'push'
args:
- 'push'
- '--all-tags'
- '${_REGION}-docker.pkg.dev/${PROJECT_ID}/${_REPOSITORY}/matrixcalc'
waitFor: ['build']
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
id: 'deploy'
entrypoint: gcloud
args:
- 'run'
- 'deploy'
- 'matrixcalc'
- '--image'
- '${_REGION}-docker.pkg.dev/${PROJECT_ID}/${_REPOSITORY}/matrixcalc:$COMMIT_SHA'
- '--region'
- '${_REGION}'
- '--platform'
- 'managed'
- '--allow-unauthenticated'
- '--set-env-vars'
- 'DATABASE_URL=${_DATABASE_URL},SECRET_KEY=${_SECRET_KEY},ALLOWED_HOSTS=*,DEBUG=False'
- '--max-instances'
- '10'
- '--min-instances'
- '0'
- '--memory'
- '512Mi'
- '--cpu'
- '1'
- '--timeout'
- '60'
waitFor: ['push']
substitutions:
_REGION: 'us-central1'
_REPOSITORY: 'matrixcalc'
_DATABASE_URL: ''
_SECRET_KEY: ''
options:
machineType: 'E2_HIGHCPU_8'
logging: CLOUD_LOGGING_ONLY
timeout: '1200s'