We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Cloud Run Review

What just happened was actually pretty amazing. A sysadmin from the early 2000s would be blown away by how easy it is to deploy a web application today. You started with a Docker Image that holds a lightweight, portable, and self-contained version of a web application, and in one click you deployed it to the public internet, complete with:

  • Load balancing
  • DNS (albeit a long, ugly URL)
  • Auto-scaling (As more and more HTTP requests come in, Cloud Run will automatically spin up more instances of your app to handle the load)
  • HTTPS

It's important to understand that many companies have a more complex setup and do a lot of that stuff manually. Levels of complexity vary dramatically in CI/CD automation from one company to the next, just like levels of complexity vary dramatically in applications from one company to the next.

Just to give you a taste of the variety of CI/CD flavors, I want you to know that some companies isolate CI from CD into two separate systems, e.g. Jenkins for CI vs Rundeck for CD. On the flip side, you will also find companies that bundle CI/CD together into a single job that builds and deploys the application. If there's a different way to do CI/CD, there's a company out there somewhere prototyping it. Now that's enterprise coding!

Regardless, the principle is the same everywhere. At its core, CI/CD enables us so that:

  • When PRs are opened, run static analysis and tests
  • When PRs are merged, build and deploy the app automatically

That "build and deploy the app automatically" can be 10 lines of yaml or it can be thousands of lines of custom bash scripts. It all depends on the complexity of the app and the needs of the company.

What Makes a “Good” CI/CD Pipeline?

  • Deterministic builds. The same code should always produce the same build.
  • Fast builds. The faster the better. This makes getting bug fixes and new features out to users faster.
  • Portable. This is why I love when the majority of a CI/CD pipeline is just bash scripts. It's easy to run locally, and it's easy to run on any CI/CD platform.
  • Fully automated. The fewer manual steps, the better. It's really annoying to manually run database migrations and click buttons. It's also error-prone.