In this article, we are going to dive into the world of CI/CD pipelines. There are a lot of different options for incorporating a CI/CD into your development workflow. This article will focus on leveraging Google Cloud Build to handle the heavy lifting around creating and storing docker images.
If you’re interested in running custom scripts with Google Cloud Build and leveraging more powerful functionality, check out Google Cloud Build — Custom Scripts.
- Github Account
- Github Repository with Dockerfile
- GCP Account
If you don’t have a Dockerfile already then check out our repository. You can fork the repository or just copy the files to follow along with this tutorial.
Navigate to Google Cloud Build:
Trigger your build via git:
Inside your locally cloned version of your application. Go ahead and make a small change then push it up to GitHub. This will kick off the Google Cloud Build trigger you’ve just created.
$: git add .
$: git commit -m "test trigger"
$: git push origin master
Check build history:
When the build kicks off you will be able to watch the build happen from the Google Cloud Build History tab.
Navigate to container registry:
Container Registry is google drive for container images. Amazon has their own version called, ECR. They both just help store your container images so they can easily be accessible by the supporting cloud provider services. On GCP this would be GKE (Google Kubernetes Engine).
Check out your uploaded container image:
The stored image should reflect your fully built application docker image which was created from your Dockerfile. The hard part is usually getting your container images on the cloud. Google Cloud Build makes this really simple.
Done 🎉. Powerful and easy. We didn’t have to set up a build server, manage any credentials, or any other headaches with other CI/CD pipelines. This was literally dead simple.
Now we have a way for our developers to make changes to the Dockerfile and then push it up to Google Container Registry. All through their normal git workflow!
If you’re interested in the other half where we actually deploy the docker container via GKE (Google Kubernetes Engine), stay tuned.
- Industry Predictions for 2019
- Best Practices for Serverless Development
- Serverless CI/CD
- Serverless Web Applications — AWS v GCP
- Serverless Impact, Developer Velocity
- Guide, First Serverless Project
What does Serverless Guru do?
Serverless Guru helps companies build scalable and cost-effective applications on the cloud. We help train companies on how to leverage IAC, serverless, and cloud-native services. We help migrate existing applications to the cloud and optimize existing applications on the cloud to be more cost-effective. We are a Serverless development partner and an AWS Consulting partner.
What did we miss?
When you leave your answer make sure to either comment below or tweet your answer to @serverlessgurux on Twitter.
Founder — Serverless Guru
LinkedIn — @ryanjonesirl
Twitter — @ryanjonesirl
Thanks for reading 😃