Courseiva
Building and testing applicationsmediumMultiple SelectObjective-mapped

PCD Building and testing applications Practice Question

A development team is building a containerized application on Google Cloud. They want to implement a CI/CD pipeline that automatically builds and tests their application on every push to the main branch. Which TWO actions should they take to achieve this?

⚠ Common exam trap

A common mix-up: candidates confuse deployment targets (like Cloud Run) or time-based schedulers (like Cloud Scheduler) with event-driven CI/CD triggers, missing that only a push-based trigger combined with a build configuration file directly achieves the requirement.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Configure a Cloud Build trigger to run on push events to the main branch.

Cloud Build triggers can be configured to automatically start a build whenever a push event occurs on a specific branch, such as main. This is the standard way to initiate a CI/CD pipeline in response to code changes in Google Cloud.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Configure a Cloud Build trigger to run on push events to the main branch.

    Why this is correct

    Cloud Build triggers on push events enable automatic builds and tests.

  • Add a cloudbuild.yaml file to the repository that defines build steps and tests.

    Why this is correct

    A cloudbuild.yaml file specifies the build and test steps executed by Cloud Build.

  • Enable Cloud Run for Anthos to automatically deploy after build.

    Why it's wrong here

    Cloud Run for Anthos is for deployment, not for building and testing.

  • Use Cloud Scheduler to trigger a Cloud Build trigger every 5 minutes.

    Why it's wrong here

    Cloud Scheduler triggers on a schedule, not on code push; not event-driven.

  • Create a Cloud Source Repository and use Cloud Functions to build on push.

    Why it's wrong here

    Cloud Functions is not designed for building and testing; Cloud Build is the appropriate service.

About these practice questions

One of 964 original PCD practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This PCD practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PCD exam.