Skip to content
Proud to collaborate with Microsoft for Startups

gcp.cloudbuild.repository.ensure ​

Link a repository under a Cloud Build 2nd-gen connection so image.build can use it as a connectedRepository source.

Ensure a repository is linked under a Cloud Build 2nd-gen host connection.

Once linked, repository_name (the full resource name) is what gcp.cloudbuild.image.build consumes as its github_repo / connectedRepository source — so a PRIVATE repo builds without staging a tarball. Idempotent: describes an existing link rather than failing.

Overview ​

PropertyValue
Workflow typeLinear
LibraryBase-gcp
Version1.0

Input Schema ​

FieldTypeRequiredDefaultDescription
connection_uuiduuidYes—GCP CloudConnection UUID.
project_idstringNo—GCP project override; defaults to the connection project.
locationstringYes—Cloud Build region, e.g. us-central1.
connection_idstringYes—Host-connection id the repository links under.
repository_idstringYes—Repository id, e.g. calendar.
remote_uristringYes—Repository clone URL, e.g. https://github.com/islasoftwarefactory/calendar.git.
annotationsjsonNo—Repository annotations.
poll_interval_secondsintegerNo—LRO poll interval.
timeout_secondsintegerNo—LRO wait timeout.

Output Schema ​

FieldTypeRequiredDefaultDescription
connection_uuiduuidNo—Echoed connection UUID.
project_idstringNo—Effective project id.
locationstringNo—Build region.
connection_idstringNo—Host-connection id.
repository_idstringNo—Repository id.
repository_namestringNo—Full repository resource name — the image.build connectedRepository source.
remote_uristringNo—Repository clone URL.
createdbooleanNo—True when the link was newly created.
repositoryjsonNo—Sanitized provider repository resource.
failure_reasonstringNo—Human-readable failure reason.
failed_stepstringNo—Failed logical step.
failed_layerjsonNo—Engine failed layer envelope.
failed_at_statestringNo—State where failure occurred.
errorstringNo—Error message.
error_typestringNo—Error class.

States ​

StateInitialTerminalSuccessAuto-advanceDescription
pendingYesNo—preflight—
ensuringNoNo—complete—
preflightingNoNo—execute—
completedNoYesYes——
failedNoYesNo——

State Diagram ​

Transitions ​

FromActionToDescription
pendingpreflightpreflighting—
preflightingexecuteensuring—
ensuringcompletecompleted—
* (any state)failfailed—

API Usage ​

bash
POST /api/workflows/start
Content-Type: application/json

{
  "workflow_type": "gcp.cloudbuild.repository.ensure",
  "initial_data": {
    "connection_uuid": "value",
    "location": "value",
    "connection_id": "value",
    "repository_id": "value"
  }
}