Skip to content

Cloud Build

Medium — good to knowCloud & Infra

ELI5 — The Vibe Check

Cloud Build is GCP's CI/CD service that runs your build, test, and deploy pipeline in the cloud. Push code to GitHub, Cloud Build picks it up, runs your steps (build Docker image, run tests, push to registry, deploy to Cloud Run), and your app is live. Like GitHub Actions but living entirely inside GCP.

Real Talk

Google Cloud Build is a fully managed CI/CD service that executes builds on GCP infrastructure. Builds are defined as sequences of steps in YAML (cloudbuild.yaml) using builder images. It integrates with Cloud Source Repositories, GitHub, Bitbucket, Artifact Registry, and all GCP deployment targets. Charged per build-minute.

Show Me The Code

# cloudbuild.yaml — build, test, and deploy to Cloud Run
steps:
  - name: 'node:18'
    entrypoint: 'npm'
    args: ['ci']
  - name: 'node:18'
    entrypoint: 'npm'
    args: ['test']
  - name: 'gcr.io/cloud-builders/docker'
    args: ['build', '-t', 'gcr.io/$PROJECT_ID/my-app:$COMMIT_SHA', '.']
  - name: 'gcr.io/cloud-builders/docker'
    args: ['push', 'gcr.io/$PROJECT_ID/my-app:$COMMIT_SHA']
  - name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
    args:
      - 'gcloud'
      - 'run'
      - 'deploy'
      - 'my-app'
      - '--image=gcr.io/$PROJECT_ID/my-app:$COMMIT_SHA'
      - '--region=us-central1'

When You'll Hear This

"Cloud Build runs the tests and deploys to Cloud Run on every push to main." / "The Cloud Build trigger is connected to the GitHub repo."

Made with passive-aggressive love by manoga.digital. Powered by Claude.