CI/CD Flashcards

1
Q

What is Cloud Build?

A

Cloud Build is a CI/CD pipeline service offered by GCP. It has stronger support for CI than CD.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Summarize the steps in this YAML file.

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the difference between Cloud Deploy and Cloud Deployment Manager?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the difference between Cloud Deployment Manager and Terraform?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does the Cloud Foundation Toolkit provide?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

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?

A

gcloud auth configure-docker ${REGION}-docker.pkg.dev

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the different ways to build container images using Cloud Build?

A
  1. Configuration file (YAML or JSON)
  2. Dockerfile
  3. Buildpacks

While all 3 can be use to build container images, only configuration files can be used to implement a CI/CD pipeline.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

When using Cloud Build, each step in your configuration file is a ….

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'
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

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?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are the 2 ways to execute Cloud Build?

A
  1. Automatically through triggers
  2. Manually through gcloud
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are the 3 general supported Cloud Build event triggers?

A
  1. Repository triggers
  2. Pub/Sub Topic triggers
  3. Webhook triggers
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What field can you declare on a Cloud Build configuration file to push an image to Artifact Registry?

A
steps:
    ...
images: 
    - "region-docker.pkg.dev..."
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Is a Cloud Storage Bucket created when using the gcloud builds submit command for the first time?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the format for tagging images so that they can be stored in Artifact Registry?

A
<regional-repository>-docker.pkg.dev/my-project/my-repo/my-image
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are the 2 different continuous delivery target environments that Cloud Deploy supports?

A
  1. Cloud Run
  2. GKE

Cloud Deploy automates delivery of your applications to a series of target environments in a defined sequence.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the command to perform on-demand container image analysis?

A

gcloud artifacts docker images scan <image>