nerdexam
Google

PROFESSIONAL-CLOUD-DEVELOPER · Question #245

You are developing a new web application using Cloud Run and committing code to Cloud Source Repositories. You want to deploy new code in the most efficient way possible. You have already created a Cl

The correct answer is B. Create a build trigger that runs the build file in response to a repository code being pushed to the. Since the Cloud Build YAML file and gcloud run deploy command already exist, the most efficient next step is to automate triggering that build whenever new code is pushed. Creating a Cloud Build trigger (B) that watches the Cloud Source Repository and fires the existing build con

Implementing CI/CD Pipelines

Question

You are developing a new web application using Cloud Run and committing code to Cloud Source Repositories. You want to deploy new code in the most efficient way possible. You have already created a Cloud Build YAML file that builds a container and runs the following command:

gcloud run deploy. What should you do next?

Options

  • ACreate a Pub/Sub topic to be notified when code is pushed to the repository. Create a Pub/Sub
  • BCreate a build trigger that runs the build file in response to a repository code being pushed to the
  • CCreate a webhook build trigger that runs the build file in response to HTTP POST calls to the
  • DCreate a Cron job that runs the following command every 24 hours: gcloud builds submit.

How the community answered

(27 responses)
  • B
    89% (24)
  • C
    7% (2)
  • D
    4% (1)

Explanation

Since the Cloud Build YAML file and gcloud run deploy command already exist, the most efficient next step is to automate triggering that build whenever new code is pushed. Creating a Cloud Build trigger (B) that watches the Cloud Source Repository and fires the existing build configuration on every push is the standard Google-recommended CI/CD pattern - it is event-driven, requires no extra infrastructure, and integrates natively with Cloud Source Repositories. Using Pub/Sub (A) adds unnecessary complexity. A webhook trigger (C) is designed for external Git providers (GitHub, Bitbucket), not Cloud Source Repositories. A daily cron job (D) is neither efficient nor event-driven.

Topics

#CI/CD#Cloud Build#Automated Deployment#Cloud Source Repositories

Community Discussion

No community discussion yet for this question.

Full PROFESSIONAL-CLOUD-DEVELOPER Practice