-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcloudbuild.yaml
30 lines (29 loc) · 1.18 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
steps:
# Build and tag using commit sha
- name: 'gcr.io/cloud-builders/docker'
id: "docker build"
args: ['build', '-t', 'us-central1-docker.pkg.dev/${PROJECT_ID}/my-docker-repo/my-image:$SHORT_SHA', '.', '-f', 'Dockerfile']
# Push the container image into AR
- name: 'gcr.io/cloud-builders/docker'
id: "docker push"
args: ['push', 'us-central1-docker.pkg.dev/${PROJECT_ID}/my-docker-repo/my-image:$SHORT_SHA']
# Deploy cloud run via gcloud CLI
#- name: 'gcr.io/cloud-builders/gcloud'
# id: "run deploy"
# args: ['run', 'deploy', 'demo-btykkrf-target-1',
# '--image=us-central1-docker.pkg.dev/bondarevskiy1/my-docker-repo/my-image:$SHORT_SHA',
# '--region=us-central1']
# Deploy via Cloud Deploy
- id: "deploy releases"
name: 'gcr.io/cloud-builders/gcloud'
args:
[
"deploy", "releases", "create", "rel-$SHORT_SHA",
"--delivery-pipeline=cloud-run-pipeline",
"--region=us-central1",
"--skaffold-file=deploy/skaffold.yaml",
"--images", "image1=us-central1-docker.pkg.dev/$PROJECT_ID/my-docker-repo/my-image:$SHORT_SHA"
]
# Add logging field to specify logging option
options:
logging: CLOUD_LOGGING_ONLY