How to CI/CD on Google Cloud Platform

Using Cloud Build, Google Container Registry, and Cloud Run to continuously build and deploy a simple Java application

Gaurav Agarwal
The Startup
Published in
5 min readApr 27, 2020

--

Photo by Everson Mayer on Unsplash

Google Cloud Platform is one of the leading cloud providers in the public cloud market. It provides a host of managed services, and if you are running exclusively on Google Cloud, it makes sense to use the managed CI/CD tools that Google Cloud provides.

A typical Continuous Integration & Deployment setup on Google Cloud Platform looks like the below.

Google Cloud CI/CD
  1. Developer checks in the source code to a Version Control system such as GitHub
  2. GitHub triggers a post-commit hook to Cloud Build.
  3. Cloud Build builds the container image and pushes to Container Registry.
  4. Cloud Build then notifies Cloud Run to redeploy
  5. Cloud Run pulls the latest image from the Container Registry and runs it.

In this mini-guide, we will use Google Cloud Build to build a simple java application, store the docker image in Google Container Registry, and deploy it to Google Cloud Run.

--

--

Gaurav Agarwal
The Startup

Author of Modern DevOps Practices — https://packt.link/XUMM3 | Certified Kubernetes Administrator | Cloud Architect | Connect @ https://gauravdevops.com