CI/CD Flashcards
What is Cloud Build?
Cloud Build is a CI/CD pipeline service offered by GCP. It has stronger support for CI than CD.
Summarize the steps in this YAML file.
Each step must contain a name field that
specifies a cloud builder, which is a container image that runs common tools. In this
sample, we have a build step with a docker builder, which is an image running
Docker. The args field of a step takes a list of arguments and passes them to the builder. The
values in the args list are used to access the builder’s entrypoint. If the builder does
not have an entrypoint, the first element in the args list is used as the entrypoint.
What is the difference between Cloud Deploy and Cloud Deployment Manager?
What is the difference between Cloud Deployment Manager and Terraform?
What does the Cloud Foundation Toolkit provide?
The Cloud Foundation Toolkit provides templates for Cloud Deployment Manager and Terraform which reflect Google Cloud best practices. These templates can be used to quickly build repeatable enterprise-ready foundations in Google Cloud.
When needing to push container images from Docker to Artifact Registry, what gcloud command must you execute for Docker to be able to authenticate itself to Artifact Registry?
gcloud auth configure-docker ${REGION}-docker.pkg.dev
What are the different ways to build container images using Cloud Build?
- Configuration file (YAML or JSON)
- Dockerfile
- Buildpacks
While all 3 can be use to build container images, only configuration files can be used to implement a CI/CD pipeline.
When using Cloud Build, each step in your configuration file is a ….
Container image that is executed as a container. These container images are also called cloud builders.
For example:
steps: - name: 'gcr.io/cloud-builders/docker'
Understanding that any data created in one step of your Cloud Build configuration file does not carry over to other steps by default, what can you do to pass from previous steps to future steps?
You can attach volumes to your build steps. By default, Cloud Build provides a volume to the /workspace
directory. Therefore, if a build step writes data into that directory, that same data can be read by future build steps.
What are the 2 ways to execute Cloud Build?
- Automatically through triggers
- Manually through gcloud
What are the 3 general supported Cloud Build event triggers?
- Repository triggers
- Pub/Sub Topic triggers
- Webhook triggers
What field can you declare on a Cloud Build configuration file to push an image to Artifact Registry?
steps: ... images: - "region-docker.pkg.dev..."
Is a Cloud Storage Bucket created when using the gcloud builds submit
command for the first time?
Yes. When you run gcloud builds submit
for the first time in a Google Cloud project, Cloud Build creates a Cloud Storage bucket named [YOUR_PROJECT_NAME]_cloudbuild in that project. Cloud Build uses this bucket to store any source code that you might use for your builds. Cloud Build does not automatically delete contents in this bucket. To delete objects you’re no longer using for builds, you can either set up lifecycle configuration on the bucket or manually delete the objects.
What is the format for tagging images so that they can be stored in Artifact Registry?
<regional-repository>-docker.pkg.dev/my-project/my-repo/my-image
What are the 2 different continuous delivery target environments that Cloud Deploy supports?
- Cloud Run
- GKE
Cloud Deploy automates delivery of your applications to a series of target environments in a defined sequence.