Loading...
Loading...
Teaches the fundamentals of Google Cloud Build (GCB). 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.
npx skill4agent add google/skills cloud-build-basicsgcloud auth login
gcloud auth application-default logingcloud config set project <PROJECT_ID>gcloud services enable cloudbuild.googleapis.comroles/cloudbuild.builds.editorroles/serviceusage.serviceUsageAdmin| Concept | Description |
|---|---|
| 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 |
| 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. |
https://console.cloud.google.com/cloud-build/buildsSUCCESSFAILUREWORKINGQUEUED[!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 theskill). Note that region settings for triggers and builds are immutable after creation and must be chosen deliberately.cb-list-build-zero-state
https://console.cloud.google.com/cloud-build/triggersgithub-main-branch-buildglobal^main$^developcloudbuild.yaml[!TIP] Theskill provides detailedcb-create-triggercommands for creating triggers across all types (GitHub, Pub/Sub, Webhook) and configurations (inline, Dockerfile, YAML). Use that skill for CLI automation.gcloud
[!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_VERSIONgcloud builds triggers run# 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] Theskill provides more complex invocation examples, including running against a specific commit SHA or using tags.cb-run-trigger
cb-create-triggercb-list-build-zero-statecb-run-triggergcloud