executing-plans
executing-plans
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available
or `^develop`).\n\n### Step 3: Configure Build Settings\n\n1. **Configuration**: Select **Cloud Build configuration file (yaml or json)**.\n2. **Location**: Keep the default **Repository** and specify the path to your build configuration file (e.g., `cloudbuild.yaml`).\n * *Alternative*: For very simple builds, you can choose **Inline** to paste the YAML configuration directly into the trigger.\n3. **(Optional) Service Account**: For production environments, select a dedicated service account with limited permissions to enforce the principle of least privilege.\n\n### Step 4: Save and Test\n\n1. Click **Create**. The trigger is now active and will run automatically on the next matching Git push.\n\n> [!TIP]\n> The `cb-create-trigger` skill provides detailed `gcloud` commands for creating triggers across all types (GitHub, Pub/Sub, Webhook) and configurations (inline, Dockerfile, YAML). Use that skill for CLI automation.\n\n## Running an Existing Trigger Manually\n\nSometimes 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).\n\n> [!IMPORTANT]\n> **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.\n\n### Option A: Via the Cloud Console\n\n1. Navigate to the **Cloud Build Triggers** page (`https://console.cloud.google.com/cloud-build/triggers`).\n2. Locate the trigger you wish to run.\n3. Click the vertical ellipsis (⋮) next to the trigger and select **Run**.\n4. A dialog will appear, allowing you to specify:\n * **Source branch/tag**: Choose the specific Git reference to build from.\n * **Substitution Variables**: Override any existing substitution variables (e.g., set `_VERSION` to a new value).\n5. Click **Run trigger**. The build will start immediately, and you can monitor its status on the **History** page.\n\n### Option B: Via the gcloud CLI\n\nUse the `gcloud builds triggers run` command to invoke the trigger and optionally override parameters.\n\n```bash\n# Run the trigger against the 'main' branch\ngcloud builds triggers run \u003cTRIGGER_NAME> \\\n --region=\u003cREGION> \\\n --branch=main\n\n# Run the trigger and override a substitution variable\ngcloud builds triggers run \u003cTRIGGER_NAME> \\\n --region=\u003cREGION> \\\n --branch=main \\\n --substitutions=_IMAGE_TAG=\"20231027-manual\"\n\n# Monitor the initiated build\n# Note: The run command outputs the build ID. Use it to check status:\n# gcloud builds log \u003cBUILD_ID> --region=\u003cREGION>\n```\n\n> [!NOTE]\n> The `cb-run-trigger` skill provides more complex invocation examples, including running against a specific commit SHA or using tags.\n\n## Related Skills\n\n* [`cb-create-trigger`](references/cb-create-trigger.md): Detailed CLI-focused instructions for creating all trigger types.\n* [`cb-list-build-zero-state`](references/cb-list-build-zero-state.md): Advanced management of the Cloud Build dashboard and onboarding zero state.\n* [`cb-run-trigger`](references/cb-run-trigger.md): Comprehensive guide to manually running triggers using various `gcloud` options.\n\n## External Resources & Documentation\n\n* [Cloud Build Documentation](https://cloud.google.com/build/docs)\n* [Cloud Build Configuration File Schema](https://cloud.google.com/build/docs/build-config-file-schema)\n* [Automating Builds with Triggers](https://cloud.google.com/build/docs/automating-builds/create-manage-triggers)\n* [gcloud CLI builds Reference](https://cloud.google.com/sdk/gcloud/reference/builds)\n","licenseDocuments":[]}}
cloud-build-basicsTeaches 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.
Independent GitHub snapshot · Automated classification · Original documentation governs
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.