GOOGLE-PROFESSIONAL-CLOUD-DEVELOPER practice question 21 of 35
You are using Cloud Build to create a new Docker image on each source code commit to a Cloud Source Repositoties 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?
Full set: 265 questionsThe most effective and standard method for releasing specific versions of software from a source control repository is by using Git tags. A Git tag marks a specific point in the repository's history, typically used to denote a release version (e.g., v1.0.1). Cloud Build natively supports creating triggers that activate when a new tag matching a specified pattern is pushed to the repository. By adopting a tag convention for releases (e.g., v or release-), you can create a dedicated Cloud Build trigger that automatically initiates the release process only for commits that have been explicitly tagged, fulfilling the requirement for an automated method to release specific commits.
A. Manually triggering a build is not an automated method and is prone to human error, which contradicts the core requirement of the question.
C. While using release branches is a valid Git workflow (like GitFlow), tags are the more direct and idiomatic Git feature for marking a single, specific commit as a release point.
D. Using a second repository for releases introduces unnecessary complexity, code duplication, and potential synchronization issues, which is not a recommended software development practice.
1. Google Cloud Documentation - Create and manage build triggers: This document explicitly lists the types of events that can start a build, including pushing a new tag. It states, "You can configure triggers to automatically run builds on Git repository changes, such as when a commit is pushed to a branch or a tag is pushed." The section "Create a Git tag trigger" details the exact process described in the correct answer.
Source: Google Cloud Documentation, "Create and manage build triggers", Section: "Create a Git tag trigger".
2. Google Cloud Documentation - CI/CD with Cloud Build and GKE: In tutorials demonstrating CI/CD pipelines, Google often uses Git tags to trigger deployments for specific releases. For example, a common pattern shown is having one trigger for continuous integration on every commit and a separate trigger on tags for continuous deployment/release.
Source: Google Cloud Solutions, "CI/CD on Google Cloud", Section: "Continuous delivery with Cloud Build".
3. Pro Git Book (Academic Resource): While not a Google-specific document, this widely respected book, often used in university courses, establishes the standard use case for Git tags. Chapter 2.6, "Git Basics - Tagging," explains, "Like most VCSs, Git has the ability to tag specific points in a repository’s history as being important... people typically use this functionality to mark release points (v1.0, v2.0 and so on)."
Source: Scott Chacon & Ben Straub, Pro Git, 2nd ed. (Apress, 2014), Chapter 2.6, "Git Basics - Tagging".
Keep practicing
Take the free GOOGLE-PROFESSIONAL-CLOUD-DEVELOPER practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other GOOGLE-PROFESSIONAL-CLOUD-DEVELOPER practice questions
- Question 1You have an application controlled by a managed instance group. When you deploy a new ver…
- Question 2Your service adds text to images that it reads from Cloud Storage. During busy times of t…
- Question 3You have been tasked with planning the migration of your company’s application from on-pr…
- Question 4You plan to make a simple HTML application available on the internet. This site keeps inf…
- Question 5HipLocal's APIs are showing occasional failures, but they cannot find a pattern. They wan…
- Question 6Your company has created an application that uploads a report to a Cloud Storage bucket. …
