Configuring Cloud Build Triggers for Semantic Versioning
Short answer
A Create a build trigger with the \d+.\d+.\d+ tag pattern.
Question
Key Takeaways
The question tests the ability to map semantic versioning requirements to Cloud Build trigger filters, specifically distinguishing between branch and tag patterns.
This page explains how to configure a Google Cloud Build trigger to deploy Terraform code based on semantic versioning tags while minimizing operational overhead. It establishes that using a precise regex pattern for tag creation is the correct approach.
Common mistake: Learners often confuse branch patterns with tag patterns or choose overly broad patterns like '.*' which increases overhead and risk by triggering on every commit or tag.
Expert Analysis
Why the Answer Is Correct
Option A is correct because it specifies a build trigger configured for tags (not branches) using the regular expression\d+\.\d+\.\d+. This regex precisely matches semantic versioning formats (e.g., 1.0.0, 2.1.3), ensuring the pipeline only runs when a new release tag is created. This aligns perfectly with the requirement to apply Terraform on new releases while minimizing operational overhead by ignoring non-release commits.Why the Other Options Are Wrong
Option B uses the same regex but applies it to branches. The scenario explicitly states releases are tagged, not necessarily deployed from specific named branches. Option C (. tag) would trigger on every tag, including development tags, increasing operational overhead and potentially causing premature deployments. Option D (. branch) would trigger on every branch change, violating the requirement to minimize overhead and deploy only on releases.Community Comment Notes
Community consensus strongly supports Option A. As user mT3 noted, "By specifying the tag pattern as a regular expression \d+.\d+.\d+ in the Cloud Build trigger, deployments based on Semantic Versioning tags are possible." Another learner, BlackCoffee, confirmed, "A is the right one based on semantic version format and tags," highlighting the direct mapping between the requirement and the regex syntax.Official Reference
https://cloud.google.com/build/docs/automate-builds-triggers#adding_triggers
This link opens the official vendor documentation in a new tab.
Exam Strategy
When configuring triggers for specific events like releases, always verify if the event is a branch push or a tag creation. Use precise regular expressions to match the expected data format (like semver) to avoid unintended triggers and reduce operational noise.
Frequently Asked Questions
Why not use .* tag pattern?
Can I use branch patterns for releases?
Discussion 2 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 2
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.
Related Analysis
Practice All PCDOE Questions
Access 75 questions with complete answers and detailed explanations.
View Full PCDOE Practice Test →
\d+\.\d+\.\d+in the Cloud Build trigger, deployments based on Semantic Versioning tags are possible.