A minimal CLI that demonstrates the core CLOUDRUN_SYNC deployment flow against a real GCP Cloud Run service.
Built as proof of work for the GSoC 2026 proposal: GCP Cloud Run plugin for PipeCD v1.
The 6-step flow in main.go is a direct port of ensureSync() from the v0 PipeCD executor (pkg/app/piped/executor/cloudrun/deploy.go):
load service.yaml
→ compute revision name (image tag + commit hash)
→ set revision name in manifest (spec.template.metadata.name)
→ set traffic split (spec.traffic → [{revision: 100%}])
→ apply tracking labels (pipecd-dev-managed-by, pipecd-dev-commit-hash, ...)
→ call GCP Cloud Run API (Create if new, Update if exists)
→ poll revision readiness (Ready=True, Active=True)
→ SUCCESS
This is the same logic that will live inside ExecuteStage() for the CLOUDRUN_SYNC stage in the v1 plugin (pkg/app/pipedv1/plugin/cloudrun/deployment/), with sdk.StageLogPersister replacing stdout and CloudRunDeployTargetConfig replacing the CLI flags.
| File | Source |
|---|---|
manifest.go |
Ported from platformprovider/cloudrun/servicemanifest.go |
client.go |
Ported from platformprovider/cloudrun/client.go + executor/cloudrun/cloudrun.go |
main.go |
Mirrors ensureSync() in executor/cloudrun/deploy.go |
service.yaml |
Minimal Cloud Run service manifest (uses public gcr.io/cloudrun/hello image) |
Prerequisites:
- GCP project with Cloud Run API enabled
gcloud auth application-default login(or a service account key file)
# Enable Cloud Run API
gcloud services enable run.googleapis.com --project=YOUR_PROJECT
# Authenticate
gcloud auth application-default login
# Deploy (first run — creates the service)
go run . --project=YOUR_PROJECT --region=us-central1 --commit-hash=abc1234
# Deploy again (second run — updates the service, new revision)
go run . --project=YOUR_PROJECT --region=us-central1 --commit-hash=def5678Flags:
| Flag | Default | Description |
|---|---|---|
--project |
(required) | GCP project ID |
--region |
us-central1 |
Cloud Run region |
--service-yaml |
service.yaml |
Path to service manifest |
--credentials-file |
(none) | Service account key JSON; uses ADC if omitted |
--commit-hash |
random | Commit hash for revision naming |
Run 1 — service created, revision hello-cloudrun-latest-abc1234 ready in 14s:
Run 2 — service updated, new revision hello-cloudrun-latest-def5678 ready in 13s:
GCP Console — two revisions, 100% traffic on the latest:
The v0 code in platformprovider/cloudrun/ and executor/cloudrun/ is battle-tested but hardcoded into the piped binary. This MVP confirms that the core logic — manifest mutation, GCP API calls, revision polling — ports cleanly into a standalone module with no v0-specific dependencies.
In the v1 plugin, the same logic moves into ExecuteStage(), with two changes:
- CLI flags →
dts[0].Config(CloudRunDeployTargetConfig: project, region, credentialsFile) log.Printf→input.Client.ReportStageLogs()viasdk.StageLogPersister


