Google Professional Cloud Developer exam dumps

Google Professional Cloud Developer practice question 390 of 481

Professional Cloud Developer. Professional level, Google Cloud. Free question with the correct answer and a full explanation.

Google Professional Cloud Developer Question 390

Select 3Google Cloud Platform

You are a developer tasked with building a container image for your application using Cloud Build. The application source code is stored in a GitHub repository. You want to ensure the build process automatically triggers whenever new code is pushed to the main branch. Which steps should you take to achieve this?

  1. A

    Connect the GitHub repository to your Google Cloud project using the Cloud Build GitHub App.

  2. B

    Create a cloudbuild.yaml file in the root directory of your repository to define the build steps.

  3. C

    Manually build the container image using the gcloud builds submit command each time code is pushed.

  4. D

    Create a trigger in Cloud Build that listens to changes in the main branch of your GitHub repository.

  5. E

    Configure a Dockerfile to be used by Cloud Build and include it in the repository.

Show answer and explanation

Correct answers: A, B, D

Explanation

To automate the container image build process using Cloud Build, you need to connect your GitHub repository to Cloud Build using the GitHub App and define the build process in a cloudbuild.yaml file. Additionally, you must create a trigger that listens for changes to the main branch to ensure the build runs automatically. Manual builds or simply including a Dockerfile in the repository do not meet the automation requirements.

  • A. Correct.

    Correct: Connecting the GitHub repository to Cloud Build using the GitHub App is necessary to enable automatic triggers for builds.

  • B. Correct.

    Correct: A cloudbuild.yaml file is required to define the build steps that Cloud Build should execute when triggered.

  • C. Incorrect.

    Incorrect: Manually building the container image each time code is pushed does not align with the requirement for automation.

  • D. Correct.

    Correct: Creating a trigger in Cloud Build ensures that the build process is automatically initiated whenever new code is pushed to the main branch.

  • E. Incorrect.

    Incorrect: While a Dockerfile is commonly used to build container images, simply including it in the repository is not enough to automate the build process.

Timed practice exam

Take a Google Professional Cloud Developer practice test under exam conditions

60 questions in 120 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam