liveBook · Manning

Cloudbuild.yaml

As explained in Google Anthos in Action

cloudbuild.yaml is a Cloud Build configuration file that declares the steps and parameters of a build pipeline.

cloudbuild.yaml declares the containerized steps that Cloud Build reads and executes for a CI/CD pipeline. Each step selects a cloud builder image and can run tests, build or push images, and deploy workloads. section 12.4.3

A configuration commonly coordinates:

  • Unit tests with a language runtime such as python:3.7-slim. section 12.4.3
  • Container image builds and registry pushes with the Docker cloud builder. section 12.4.3
  • Deployments to GKE, Cloud Run, Cloud Run for Anthos, or Anthos clusters on VMware. section 12.4.3
# cloudbuild.yaml
steps:
# This step runs the unit tests on the app
- name: 'python:3.7-slim'
 id: Test
...
# This step builds the container image.
- name: 'gcr.io/cloud-builders/docker'
 id: Build
...
# This step pushes the image to a container registry
- name: 'gcr.io/cloud-builders/docker'
 id: Push
... 
# This step deploys the new version of our container image
- name: 'gcr.io/cloud-builders/kubectl'
 id: Deploy

Review a compact configuration showing test, build, push, and deployment steps. section 12.4.3

How Google Anthos in Action covers it

How deep it goes
Defines step images and execution parameters, but defers detailed cloud builder behavior to separate treatment.
Examples
Demonstrates Python tests, Docker builds and pushes, GKE deployment, Cloud Run deployment, and Anthos VMware deployment.
What it assumes
Assumes familiarity with container images, registries, Kubernetes deployments, and Google Cloud compute services.
What you can do after
Build it from scratch to automate tests, container image delivery, and workload deployment with Cloud Build.
How it connects
Connects CI/CD with cloud builders, Docker, container registries, Kubernetes, GKE, Cloud Run, and Anthos.

This explainer was generated by Manning's knowledge graph from the text of Google Anthos in Action. The section links point to the parts of the book it draws on.