canonical: https://jentic.com/apis/googleapis.com/cloudbuild

# Google Cloud Build API

Google Cloud Build is a managed continuous-integration service that compiles source code, runs tests, and produces container images or other artifacts on Google Cloud. The API exposes builds, build triggers, worker pools, and GitHub webhook integration so agents can launch builds on demand, configure triggers that fire on Git events, and inspect build logs and status. Builds run in isolated VMs with configurable machine size and private worker pools for builds that need access to internal networks.

## For AI agents

Trigger, monitor, and manage Google Cloud Build CI/CD pipelines, including build triggers, worker pools, and GitHub webhook integration. Useful for automated build, test, and image-publishing workflows on GCP.

## Scope

Does not deploy artifacts to runtime environments, host source repositories, or store built images - use for build, test, and trigger orchestration only.

## Capabilities

- Submit a build directly to Cloud Build with inline build steps and source
- Create build triggers that fire on push, pull-request, or tag events from GitHub or Cloud Source Repositories
- Cancel a running build or retry a failed build by ID
- Provision and manage private worker pools for builds that need VPC access
- List historical builds for a project with pagination and filtering
- Receive GitHub webhook events at the githubDotComWebhook endpoint to drive build triggers
- Run a build trigger on demand with a specified branch or tag substitution

## Use cases

### GitHub-Driven Container Build Pipeline

Engineering teams use Cloud Build triggers to build and push container images on every commit to a GitHub repository. The trigger watches a branch pattern, runs a cloudbuild.yaml that builds the Dockerfile, runs tests, and pushes the resulting image to Artifact Registry. Setup takes under an hour for a single repo and triggers can be templated across many services.

Example prompt: Call POST /v1/projects/{projectId}/triggers with a github filter on branch=main and a build configuration that builds and pushes to us-docker.pkg.dev

### On-Demand Build for Release Candidates

Release engineers fire builds on demand to produce a release candidate image for a specific tag. The runTrigger operation accepts the trigger ID and a substitutions map (TAG_NAME, COMMIT_SHA), kicks off the build, and returns a long-running operation the caller can poll. Common in release-pipeline orchestration where the build is one step in a larger workflow.

Example prompt: Call POST /v1/projects/{projectId}/triggers/{triggerId}:run with branchName=release/v1.4.0 and TAG_NAME substitution

### Build Status Reporting and Failure Triage

On-call engineers and dashboards call the builds list and get endpoints to surface the status of recent builds, identify failures, and cancel runaway jobs. Filters by status (FAILURE, TIMEOUT) and trigger ID make it easy to attribute breakages to specific pipelines.

Example prompt: Call GET /v1/projects/{projectId}/builds?filter=status="FAILURE" and cancel any build older than one hour via /builds/{id}:cancel

### AI Agent Release Operator via Jentic

An agent invoked by a release operator searches Jentic for the right Cloud Build operation, fires the release trigger with the correct tag, polls for completion, and reports the resulting image digest. The agent never sees the underlying service account key - Jentic injects a scoped token at execution time.

Example prompt: Search Jentic for 'run google cloud build trigger', execute against /triggers/{triggerId}:run with TAG_NAME substitution, then poll /builds/{id} until status is SUCCESS

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | /v1/projects/{projectId}/builds | Submit a new build |
| GET | /v1/projects/{projectId}/builds | List builds for a project |
| POST | /v1/projects/{projectId}/builds/{id}:cancel | Cancel a running build |
| POST | /v1/projects/{projectId}/builds/{id}:retry | Retry a failed build |
| POST | /v1/projects/{projectId}/triggers | Create a build trigger |
| POST | /v1/projects/{projectId}/triggers/{triggerId}:run | Run a build trigger on demand |
| POST | /v1/githubDotComWebhook:receive | Receive a GitHub webhook event |

## Key resources

- **Builds** — Individual build executions with status, logs, and produced artifacts
- **Triggers** — Build triggers that fire on Git events or webhook calls
- **WorkerPools** — Private worker pools that provide network-isolated build VMs
- **Webhooks** — GitHub webhook receiver that drives event-based triggers

## Why Jentic

- **Setup:** Wiring Cloud Build by hand means setting up Google OAuth 2.0, minting short-lived access tokens against the cloud-platform scope, and pointing every call at cloudbuild.googleapis.com yourself. Through Jentic you install once, import the Cloud Build API from the API Directory, store the OAuth credential once, and your agent calls it.
- **Permission scoping:** Cloud Build puts the project and build ids in the URL path (/v1/projects/{projectId}/builds/{id}), so a rule can pin your agent to one project: it can create and list builds and run triggers there and nothing else. You choose the operations it may call, so build cancellation or trigger deletion are not included unless you add them.
- **Credential handling:** Your Cloud Build OAuth credential is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'trigger a Google Cloud build' or 'cancel a running build', and Jentic returns the matching Cloud Build operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Artifact Registry API** — Stores the container images and language packages that Cloud Build produces
- **GitHub REST API** — Source-control side of GitHub-driven Cloud Build triggers
- **Cloud Deploy API** — Promotes the artifacts produced by Cloud Build through staged delivery pipelines
- **GitLab REST API** — Self-hosted or SaaS Git platform with its own pipeline product

## FAQ

### What authentication does the Cloud Build API use?

The Cloud Build API uses OAuth 2.0 with the cloud-platform scope. Tokens are issued for a Google service account or an end user. Through Jentic, the OAuth credential lives in your Jentic One instance and the agent receives a short-lived access token only - the underlying service account JSON never enters agent context.

### Can I trigger a Cloud Build pipeline from outside Google Cloud?

Yes. Either POST /v1/projects/{projectId}/builds with an inline build spec, or call /triggers/{triggerId}:run on an existing trigger. For GitHub-driven flows, configure the githubDotComWebhook receiver and the trigger fires automatically on each push or pull request.

### What are the rate limits for the Cloud Build API?

Cloud Build quotas are published per-method in the Google Cloud console under the Cloud Build quota page; typical defaults are several hundred build creations per minute per project, with separate concurrent-build quotas based on machine type and worker pool size.

### How do I cancel a running build through Jentic?

Search Jentic for 'cancel google cloud build' and execute the operation against POST /v1/projects/{projectId}/builds/{id}:cancel with the build ID. The build transitions to CANCELLED and any active step is terminated immediately.

### Does Cloud Build support builds in a private VPC?

Yes. Create a private worker pool via the workerPools resource, attach it to a VPC peering, and reference the worker pool in the build's options.pool field. Builds running on the pool can reach internal Artifact Registry repos, private GitHub Enterprise instances, and other VPC-only services.

### Is Cloud Build free?

Cloud Build includes a free tier of 120 build minutes per day on the smallest machine type; usage beyond that and any private worker pool runtime is billed per build minute as documented on the Cloud Build pricing page.

### Can I limit what my agent is allowed to do with the Cloud Build API?

Yes. Because Jentic One is self-hosted, your own rules decide which Cloud Build operations and credentials the agent may use. Since Cloud Build puts the project and build IDs in the URL path (/v1/projects/{projectId}/builds/{id}), you can pin the agent to a single project so it only creates and lists builds and runs triggers there and nothing else. You choose the exact operations it can call, so sensitive actions like build cancellation or trigger deletion stay off limits unless you explicitly grant them.
