Skip to main content
skill Claude Code Gemini CLI CX Codex official · Google

cloud-build-basics — Claude Code skill: what it does, install

Teaches Cloud Build basics on Google Cloud, from enabling the API to creating and manually running a trigger. Useful for a first CI workflow.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add google/skills --skill cloud-build-basics -a claude-code
Open on GitHub

What cloud-build-basics does

This skill explains Cloud Build as a serverless Google Cloud platform that turns source code into build artifacts, including container images and Java archives. It covers cloudbuild.yaml, build steps, builder containers, artifacts, and triggers.

The walkthrough includes enabling the Cloud Build API, setting the project context, opening Build History, and creating a basic trigger for pushes to a Git branch. It also covers running an existing trigger by choosing a branch or tag and overriding substitution variables that already exist in the trigger configuration.

You need the Google Cloud SDK, gcloud authentication, a Project ID, and permissions such as roles/cloudbuild.builds.editor and roles/serviceusage.serviceUsageAdmin. Read Usage Attribution before using gcloud, REST API, or MCP commands. Install this skill for basic Cloud Build tasks; private pools and complex pipeline architectures are outside its scope.

What it helps with

  • enable the Cloud Build API for a project
  • inspect build history and open detailed logs
  • create a trigger for pushes to a Git branch
  • run an existing trigger on demand
  • override a defined substitution variable

Example prompts for the agent

  • Explain Cloud Build basics and the role of `cloudbuild.yaml` in this project.
  • Walk me through creating a trigger for pushes to the `main` branch.
  • Show how to run an existing trigger and change `_VERSION`.

How to install cloud-build-basics

1Skills CLI (Vercel)

npx skills add google/skills --skill cloud-build-basics -a claude-code

2Manually: put the files in place

~/.claude/skills/cloud-build-basics/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/cloud-build-basics/

From the same set172

The whole set →
bigquery-basics official google Manages BigQuery resources and runs SQL queries. Use it to create datasets, tables and views, or handle basic data ingestion and analysis. Claude Code Gemini CLI CX Codex 17,678installs cloud-run-basics official google This skill helps an agent manage Cloud Run services, jobs, and worker pools when a project needs HTTP deployment, scheduled work, or pull-based background processing. Claude Code Gemini CLI CX Codex 17,532installs gemini-api official google Connects Gemini API from Google Cloud Agent Platform to the agent. Gives access to Gemini models, multimodal input, function calling, and context caching. Claude Code Gemini CLI CX Codex 17,116installs google-cloud-recipe-auth official Google LLC This skill explains Google Cloud authentication and permissions. Use it when setting up IAM, ADC, or service accounts for local code and production workloads. Claude Code Gemini CLI CX Codex 15,450installs google-cloud-recipe-onboarding official Google LLC Guides a developer through a first Google Cloud project: CLI checks, sign-in, project setup and billing. It fits a personal first project. Claude Code Gemini CLI CX Codex 15,390installs cloud-sql-basics official google This skill helps create and explain Cloud SQL resources for MySQL, PostgreSQL, and SQL Server. Use it when setting up a database in Google Cloud. Claude Code Gemini CLI CX Codex 14,679installs google-cloud-waf-security official google This skill reviews Google Cloud workloads against the security pillar of the Well-Architected Framework and suggests actions for IAM, networks, data, and operations. Claude Code Gemini CLI CX Codex 14,620installs google-cloud-waf-cost-optimization official google Reviews Google Cloud workloads through the Well-Architected Cost Optimization pillar. Use it to inspect spending, resize resources, assess discounts, or find idle capacity. Claude Code Gemini CLI CX Codex 14,266installs

Similar

python-packaging Seth Hobson This skill turns Python libraries and CLI tools into installable packages and guides PyPI releases. Use it when a project needs a distributable structure. Claude Code CX Codex Cursor 12,915installs azure-pricing official anthonychu Fetches current Azure retail prices and estimates usage costs. Use it to compare SKUs, regions, billing models, and Copilot Studio credits. GitHub Copilot 4,700installs just casey Reference skill for just, a command runner that executes tasks from a justfile. Use when your project has a justfile or you need syntax help for recipes and commands. Claude Code CX Codex Cursor +1 1,000installs context-mode mksglu This skill routes large files and command output through context-mode tools instead of Bash. Use it to inspect logs, test results, data files, or page snapshots. Claude Code CX Codex Cursor +1 2,900installs wizard Matt Pocock This skill creates an interactive bash wizard for manual setup steps, CI secrets, third-party dashboards, and one-off migrations. Claude Code 553,369installs hyperframes-cli heygen-com Controls HyperFrames video workflows from the CLI: audits layouts and contrast, edits timeline clips, captures snapshots, and renders locally or in cloud runtimes. Claude Code CX Codex Cursor +1 1,200,000installs setup-pre-commit Matt Pocock This skill configures pre-commit checks for a JavaScript repository, running Prettier, type checking, and tests before each commit. Claude Code 489,289installs using-git-worktrees Jesse Vincent Prepares an isolated workspace before feature work or plan execution. It checks the repository first, then uses native worktree support or Git. Claude Code CX Codex 217,153installs

Questions about cloud-build-basics

How do I install cloud-build-basics in Claude Code?

Run npx skills add google/skills --skill cloud-build-basics -a claude-code. The skill file will be placed at ~/.claude/skills/cloud-build-basics/SKILL.md.

What does cloud-build-basics do?

It teaches Cloud Build concepts, API enablement, Build History, and the setup of a basic trigger for Git branch pushes. It also covers manually running an existing trigger.

What do I need before using cloud-build-basics?

You need the Google Cloud SDK, gcloud authentication, a Project ID, the enabled Cloud Build API, and suitable permissions. Usage Attribution must be read before running the listed commands.

Source text

SKILL.md · Apache-2.0
---
name: cloud-build-basics
metadata:
  version: "1.0.2"
  category: DevOps
description: >-
  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.
---

# Cloud Build Basics

## Attribution

**MUST READ**: Before executing any `gcloud`, REST API, or MCP command, you
MUST read [Usage Attribution](references/attribution.md). 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.

## Prerequisites

Before starting, ensure the following prerequisites are met:

1.  **Google Cloud SDK**: Ensure the [Google Cloud SDK](https://cloud.google.com/sdk/docs/install) is installed and configured.
2.  **Authentication**: Authenticate the gcloud CLI:
    ```bash
    gcloud auth login
    gcloud auth application-default login
    ```
3.  **Project ID**: Know the target Google Cloud Project ID. Set the context:
    ```bash
    gcloud config set project <PROJECT_ID>
    ```
4.  **Enable Cloud Build API**: The Cloud Build API must be enabled for the project.
    ```bash
    gcloud services enable cloudbuild.googleapis.com
    ```
5.  **Permissions**: Ensure the user or service account has the necessary permissions, such as `roles/cloudbuild.builds.editor` and `roles/serviceusage.serviceUsageAdmin` (to enable the API).

## Core Concepts

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. |

## Navigation: Viewing Build History

The Cloud Build Build History page is the central place to monitor the status of past and ongoing builds.

1.  **Open the Cloud Console**: Navigate to the Google Cloud Console.
2.  **Go to Cloud Build**: Use the search bar or the navigation menu to find **Cloud Build**.
3.  **Select Build History**: In the left navigation pane, select **History** (or use the direct URL: `https://console.cloud.google.com/cloud-build/builds`).
4.  **Review Builds**:
    *   **Status**: Check the status column (`SUCCESS`, `FAILURE`, `WORKING`, `QUEUED`).
    *   **Region**: Use the region filter at the top to view builds that ran in a specific region (important for regional worker pools).
    *   **Logs**: Click on a specific Build ID to view the detailed logs, execution steps, and build summary. This is crucial for debugging failed builds.

> [!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-state`](references/cb-list-build-zero-state.md) skill). Note that region settings for triggers and builds are immutable after creation and must be chosen deliberately.

## Creating a Basic Automated Trigger

This process defines an automation rule to run a build whenever code is pushed to a specified Git branch.

### Step 1: Start Trigger Creation

1.  Navigate to the **Cloud Build Triggers** page (`https://console.cloud.google.com/cloud-build/triggers`).
2.  Click **Create trigger**.

### Step 2: Configure Trigger Settings

1.  **Name**: Provide a unique, descriptive name (e.g., `github-main-branch-build`).
2.  **Region**: Select the region where the trigger configuration will be stored (e.g., `global` or a specific regional endpoint). **Note: Trigger and build region settings are immutable after creation and must be chosen deliberately.**
3.  **Event**: Select the event type. For automated CI/CD, select **Push to a branch**.
4.  **Source**: Select the repository source:
    *   **Repository**: Connect your source repository (GitHub, Bitbucket, Cloud Source Repositories, etc.). If needed, authorize the connection.
    *   **Repository Name**: Select the specific repository you want to link.
5.  **Branch**: Enter the branch pattern (e.g., `^main$` or `^develop`).

### Step 3: Configure Build Settings

1.  **Configuration**: Select **Cloud Build configuration file (yaml or json)**.
2.  **Location**: Keep the default **Repository** and specify the path to your build configuration file (e.g., `cloudbuild.yaml`).
    *   *Alternative*: For very simple builds, you can choose **Inline** to paste the YAML configuration directly into the trigger.
3.  **(Optional) Service Account**: For production environments, select a dedicated service account with limited permissions to enforce the principle of least privilege.

### Step 4: Save and Test

1.  Click **Create**. The trigger is now active and will run automatically on the next matching Git push.

> [!TIP]
> 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.

## Running an Existing Trigger Manually

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.

### Option A: Via the Cloud Console

1.  Navigate to the **Cloud Build Triggers** page (`https://console.cloud.google.com/cloud-build/triggers`).
2.  Locate the trigger you wish to run.
3.  Click the vertical ellipsis (⋮) next to the trigger and select **Run**.
4.  A dialog will appear, allowing you to specify:
    *   **Source branch/tag**: Choose the specific Git reference to build from.
    *   **Substitution Variables**: Override any existing substitution variables (e.g., set `_VERSION` to a new value).
5.  Click **Run trigger**. The build will start immediately, and you can monitor its status on the **History** page.

### Option B: Via the gcloud CLI

Use the `gcloud builds triggers run` command to invoke the trigger and optionally override parameters.

```bash
# 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-trigger` skill provides more complex invocation examples, including running against a specific commit SHA or using tags.

## Related Skills

*   [`cb-create-trigger`](references/cb-create-trigger.md): Detailed CLI-focused instructions for creating all trigger types.
*   [`cb-list-build-zero-state`](references/cb-list-build-zero-state.md): Advanced management of the Cloud Build dashboard and onboarding zero state.
*   [`cb-run-trigger`](references/cb-run-trigger.md): Comprehensive guide to manually running triggers using various `gcloud` options.

## External Resources & Documentation

*   [Cloud Build Documentation](https://cloud.google.com/build/docs)
*   [Cloud Build Configuration File Schema](https://cloud.google.com/build/docs/build-config-file-schema)
*   [Automating Builds with Triggers](https://cloud.google.com/build/docs/automating-builds/create-manage-triggers)
*   [gcloud CLI builds Reference](https://cloud.google.com/sdk/gcloud/reference/builds)

© google · Apache-2.0 · google/skills

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor