Teaches the fundamentals of Cloud Build on Google Cloud. Covers core concepts, API enablement, console navigation to the Build History page, and the end-to-end workflow for creating and manually running a basic build trigger. Do not use for managing private pools or complex pipeline architectures.
Written by Google and published in google/skills under the Apache-2.0 license. Treq shows it unchanged except for heading levels and links to files on GitHub.
MUST READ: Before executing any gcloud, REST API, or MCP command, you
MUST read Usage Attribution. For commands executed
directly in the terminal (never in generated scripts, Terraform, or user code),
prefix gcloud with
CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:cloud-build-basics)"
and append agent-skills/1.0 (skill:cloud-build-basics) to User-Agent headers.
Before starting, ensure the following prerequisites are met:
gcloud auth login
gcloud auth application-default login
gcloud config set project <PROJECT_ID>
gcloud services enable cloudbuild.googleapis.com
roles/cloudbuild.builds.editor and roles/serviceusage.serviceUsageAdmin (to enable the API).Cloud Build (GCB) is a serverless platform that executes your builds on Google Cloud. It translates your source code into deployable artifacts, such as Docker containers or Java archives.
| Concept | Description |
|---|---|
cloudbuild.yaml |
The required configuration file that defines the build steps. It is written in YAML or JSON. |
| Build Steps | A sequence of actions (steps) GCB performs. Each step runs a command inside a specific Docker container (the builder). Common builders include gcr.io/cloud-builders/gcloud, gcr.io/cloud-builders/docker, and custom containers. |
| Artifacts | The output of the build, typically a container image pushed to Google Container Registry (GCR) or Artifact Registry (AR), or other deployable files. |
| Triggers | Automation rules that invoke a build in response to an event, such as a push to a Git repository, a Pub/Sub message, or a manual request. |
The Cloud Build Build History page is the central place to monitor the status of past and ongoing builds.
https://console.cloud.google.com/cloud-build/builds).SUCCESS, FAILURE, WORKING, QUEUED).[!NOTE] If this is your first time visiting the page, you might see the "zero-state" experience, which offers options to run a sample build or create your first trigger (as noted in the
cb-list-build-zero-stateskill). Note that region settings for triggers and builds are immutable after creation and must be chosen deliberately.
This process defines an automation rule to run a build whenever code is pushed to a specified Git branch.
https://console.cloud.google.com/cloud-build/triggers).github-main-branch-build).global or a specific regional endpoint). Note: Trigger and build region settings are immutable after creation and must be chosen deliberately.^main$ or ^develop).cloudbuild.yaml).
[!TIP] The
cb-create-triggerskill provides detailedgcloudcommands for creating triggers across all types (GitHub, Pub/Sub, Webhook) and configurations (inline, Dockerfile, YAML). Use that skill for CLI automation.
Sometimes you need to run a trigger on demand, outside of its normal automation flow (e.g., to rebuild an old commit or test a new substitution).
[!IMPORTANT] Substitution Immutability: You can only override values for substitution variables that are already defined in the trigger configuration. You cannot introduce new substitution variable keys at runtime.
https://console.cloud.google.com/cloud-build/triggers)._VERSION to a new value).Use the gcloud builds triggers run command to invoke the trigger and optionally override parameters.
# Run the trigger against the 'main' branch
gcloud builds triggers run <TRIGGER_NAME> \
--region=<REGION> \
--branch=main
# Run the trigger and override a substitution variable
gcloud builds triggers run <TRIGGER_NAME> \
--region=<REGION> \
--branch=main \
--substitutions=_IMAGE_TAG="20231027-manual"
# Monitor the initiated build
# Note: The run command outputs the build ID. Use it to check status:
# gcloud builds log <BUILD_ID> --region=<REGION>
[!NOTE] The
cb-run-triggerskill provides more complex invocation examples, including running against a specific commit SHA or using tags.
cb-create-trigger: Detailed CLI-focused instructions for creating all trigger types.cb-list-build-zero-state: Advanced management of the Cloud Build dashboard and onboarding zero state.cb-run-trigger: Comprehensive guide to manually running triggers using various gcloud options.Claude Code and Codex keep each installed skill's name and description in context. When a request matches the description, the agent loads the full SKILL.md. You can also run it yourself: type /cloud-build-basics in Claude Code or $cloud-build-basics in Codex.
The description says when to use it:
use for managing private pools or complex pipeline architectures.
Copy the cloud-build-basics folder into .claude/skills/ in your project. To use it in every project, copy it into ~/.claude/skills/ instead.
git clone --depth 1 https://github.com/google/skills.git /tmp/google-skills
mkdir -p .claude/skills
cp -r /tmp/google-skills/skills/cloud/cloud-build-basics .claude/skills/
Codex reads skills from .agents/skills/ in your repository, and from ~/.agents/skills/ for every repository. It detects new skills on its own. Restart Codex if cloud-build-basics does not appear.
git clone --depth 1 https://github.com/google/skills.git /tmp/google-skills
mkdir -p .agents/skills
cp -r /tmp/google-skills/skills/cloud/cloud-build-basics .agents/skills/
Open Settings and select the Skills tab. The tab appears when Skills installation is on under Settings → Feature Preview. Search for cloud-build-basics and choose Install….
Install for repository writes the skill under .treq/skills/ in the current repository. Install for application makes it available to every repository on this machine. Each new workspace gets a copy in .claude/skills/ and .agents/skills/, so Claude Code and Codex both find it. See Installing Skills from the Library.
cloud-build-basics ships 5 files, 35.0 KB in total. Select a file to load it from GitHub.