Skip to content

Cloud CLI: Build, deploy & roll back

Cloud CLI commands for build, deploy & roll back (tags: #deploy #build #rollback #release #compose).

Index
2 items

GCP: Deploy a Cloud Run revision

Safe

Deploy a new image as a new revision and shift 100% traffic to it.

gcloud run deploy <service> --image <image> --region <region>
What each part does
  1. gcloud run deploy <service>create a new revision of the service (creates the service if missing)
  2. --image <image>container image, e.g. europe-docker.pkg.dev/proj/repo/app:1.4
  3. --region <region>region of the service

Also known as: cloud run deploy

GCP: Roll back Cloud Run traffic to a revision

Caution

Send all traffic back to a known good revision.

gcloud run services update-traffic <service> --to-revisions <revision>=100 --region <region>
What each part does
  1. gcloud run services update-traffic <service>change which revisions get traffic (no new deploy)
  2. --to-revisions <revision>=100send 100% of traffic to that revision
  3. --region <region>region of the service

Also known as: cloud run rollback

My DevOps Playbook by Angelo John Calleja

New runbook

GitHub not connected

Saving is handled by the site: the GitHub token is stored in Cloudflare, not in your browser. Enter the editor password (the EDITOR_PASSWORD secret) to unlock saving in this browser.

Saving commits to gelogrammer/My_DevOps_Playbook. Create a fine-grained token with access to only this repo andContents: Read and write, then paste it here. It is stored only in this browser.

src/content/docs/…