GCP Builder

Custom Building Machine

1
2
3
4
5
# view machine on region
gcloud compute machine-types list | grep asia-east1

# build
kbuild cloudbuild-dev.yaml --machine-type=n1-highcpu-8 .

https://cloud.google.com/compute/docs/machine-types?hl=zh-cn
https://cloud.google.com/cloud-build/docs/build-config
https://docs.docker.com/engine/reference/run/

Trigger rule

1
^release\/[0-9]{1}\.[0-9]{1,2}\.[0-9]{1,2}$|^hotfix|^master$

substitutions

Example

1
2
3
4
5
steps:
images:
- "gcr.io/$PROJECT_ID/image:${_IMAGE_VERSION}"
substitutions:
_IMAGE_VERSION: "my_image"