-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcloudbuild.yaml
35 lines (31 loc) · 1.08 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
steps:
# Build the container image
- name: 'gcr.io/cloud-builders/docker'
args: [
'build',
'-t', 'europe-west1-docker.pkg.dev/$PROJECT_ID/mars-rover/mars-rover:$COMMIT_SHA',
'-t', 'europe-west1-docker.pkg.dev/$PROJECT_ID/mars-rover/mars-rover:latest',
'.'
]
# Push the container image
- name: 'gcr.io/cloud-builders/docker'
args: ['push', 'europe-west1-docker.pkg.dev/$PROJECT_ID/mars-rover/mars-rover:$COMMIT_SHA']
- name: 'gcr.io/cloud-builders/docker'
args: ['push', 'europe-west1-docker.pkg.dev/$PROJECT_ID/mars-rover/mars-rover:latest']
# Deploy to Cloud Run
- name: 'gcr.io/cloud-builders/gcloud'
args:
- 'run'
- 'deploy'
- 'mars-rover'
- '--image'
- 'europe-west1-docker.pkg.dev/$PROJECT_ID/mars-rover/mars-rover:$COMMIT_SHA'
- '--region'
- 'europe-west1'
- '--platform'
- 'managed'
images:
- 'europe-west1-docker.pkg.dev/$PROJECT_ID/mars-rover/mars-rover:$COMMIT_SHA'
- 'europe-west1-docker.pkg.dev/$PROJECT_ID/mars-rover/mars-rover:latest'
options:
logging: CLOUD_LOGGING_ONLY