Google Cloud Professional Cloud Developer — Question 42
You are using Cloud Build to create a new Docker image on each source code commit to a Cloud Source Repositories repository. Your application is built on every commit to the master branch. You want to release specific commits made to the master branch in an automated method.
What should you do?
Answer options
- A. Manually trigger the build for new releases.
- B. Create a build trigger on a Git tag pattern. Use a Git tag convention for new releases.
- C. Create a build trigger on a Git branch name pattern. Use a Git branch naming convention for new releases.
- D. Commit your source code to a second Cloud Source Repositories repository with a second Cloud Build trigger. Use this repository for new releases only.
Correct answer: B
Explanation
The correct answer is B because creating a build trigger on a Git tag pattern allows for the automation of new releases based on specific tags, which is a standard practice for versioning. Option A is incorrect as it requires manual intervention, while options C and D do not leverage Git tags effectively for automated release management.