PROFESSIONAL-CLOUD-DEVELOPER · Question #101
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…
The correct answer is B. Create a build trigger on a Git tag pattern. Creating a Cloud Build trigger on a Git tag pattern is the correct approach for automated releases of specific commits. In Git workflows, tags (e.g., 'v1.0.0', 'release-2024-01') are used to mark specific commits as official releases. By configuring a trigger to fire when a tag…
Question
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?
Options
- AManually trigger the build for new releases.
- BCreate a build trigger on a Git tag pattern.
- CCreate a build trigger on a Git branch name pattern.
- DCommit your source code to a second Cloud Source Repositories repository with a second Cloud
How the community answered
(27 responses)- A4% (1)
- B78% (21)
- C15% (4)
- D4% (1)
Explanation
Creating a Cloud Build trigger on a Git tag pattern is the correct approach for automated releases of specific commits. In Git workflows, tags (e.g., 'v1.0.0', 'release-2024-01') are used to mark specific commits as official releases. By configuring a trigger to fire when a tag matching a pattern (like 'v*') is pushed, only intentionally tagged commits trigger a release build - giving precise control over what gets released. Option A (manual trigger) is not automated. Option C (branch name pattern) would trigger on every commit to matching branches, not just specific release commits. Option D (a second repository) adds unnecessary complexity and duplication. Git tags are the standard mechanism for marking and automating releases in CI/CD pipelines.
Topics
Community Discussion
No community discussion yet for this question.