Question 109 of 500
Building and implementing CI/CD pipelineshardMultiple SelectObjective-mapped

Quick Answer

The answer is to create a Cloud Build trigger with a tag filter '^v[0-9]+\.[0-9]+\.[0-9]+$' and use that trigger for production deployments, combined with using the $TAG_NAME substitution variable in a step condition within the cloudbuild.yaml. This works because Cloud Build’s tag filter uses regex to match the exact version tag pattern, ensuring the trigger only fires on tags like v1.2.3, while the $TAG_NAME variable allows the same pipeline to gate the production step by checking if the build was initiated by a matching tag. On the Google Professional Cloud DevOps Engineer exam, this tests your understanding of environment-specific deployment control using Cloud Build triggers and substitution variables—a common trap is confusing glob patterns (like v*.*.*) with regex, or forgetting that a single cloudbuild.yaml can serve multiple environments if you conditionally skip steps. Memory tip: think “regex trigger for the gate, $TAG_NAME for the gatekeeper.”

PCDOE Building and implementing CI/CD pipelines Practice Question

This PCDOE practice question tests your understanding of building and implementing ci/cd pipelines. This is a configuration task: choose the command set that satisfies every stated requirement. Small differences — like 'secret' vs 'password' or 'transport input ssh' vs 'all' — change whether the answer is correct. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

A team uses Cloud Build with a cloudbuild.yaml that deploys to multiple environments. They want to ensure that the production deployment step only runs when the build is triggered by a tag matching 'v*.*.*'. Which TWO configurations achieve this? (Choose two.)

Question 1hardmulti select
Full question →

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

In the cloudbuild.yaml, use a 'waitFor' condition that only runs the production step when the substitution variable $TAG_NAME matches 'v*.*.*'.

Option A is correct because Cloud Build supports substitution variables like $TAG_NAME, which can be used in a 'waitFor' condition or as part of a step's entrypoint logic to gate execution. By checking if $TAG_NAME matches the glob pattern 'v*.*.*', the production deployment step will only run when the build is triggered by a matching tag, ensuring environment-specific control within a single cloudbuild.yaml.

Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • In the cloudbuild.yaml, use a 'waitFor' condition that only runs the production step when the substitution variable $TAG_NAME matches 'v*.*.*'.

    Why this is correct

    Conditional step execution based on tag substitution.

    Related concept

    Read the scenario before looking for a memorised answer.

  • Create a Cloud Build trigger with a tag filter '^v[0-9]+\.[0-9]+\.[0-9]+$' and use that trigger for production deployments.

    Why this is correct

    Tag filter restricts trigger to matching tags.

    Related concept

    Read the scenario before looking for a memorised answer.

  • In the cloudbuild.yaml, add a condition that checks if the branch name matches 'v*.*.*'.

    Why it's wrong here

    Tags are not branch names.

  • Create a separate cloudbuild.yaml for production and use a branch filter '^main$' to trigger it.

    Why it's wrong here

    Branch filter does not match tags.

  • Configure a manual approval step in Cloud Build that requires a production manager to approve before running the production deployment.

    Why it's wrong here

    Approval does not restrict trigger to tags.

Common exam traps

Common exam trap: answer the scenario, not the keyword

Google Cloud often tests the distinction between branch-based and tag-based triggers, and candidates mistakenly apply branch filters (like '^main$') or branch-name checks when the requirement explicitly specifies tag-based triggers, leading them to select options C or D.

Detailed technical explanation

How to think about this question

Cloud Build triggers can be configured with a tag filter using a regex pattern (e.g., '^v[0-9]+\.[0-9]+\.[0-9]+$') to match semantic versioning tags, and when a tag push matches, the trigger fires with $TAG_NAME populated. Inside cloudbuild.yaml, you can use the 'entrypoint' field with a shell script that checks $TAG_NAME against a glob pattern, or leverage Cloud Build's built-in 'condition' field (in preview) to skip steps. This dual approach (trigger-level filter + step-level condition) provides defense in depth, preventing accidental production deployments even if the trigger configuration is misconfigured.

KKey Concepts to Remember

  • Read the scenario before looking for a memorised answer.
  • Find the constraint that changes the correct option.
  • Eliminate answers that are true in general but not in this case.

TExam Day Tips

  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Real-world example

How this comes up in practice

A cloud solutions architect for a retail company is evaluating services for a new workload. The correct answer here reflects best practice for the specific scenario described — not a general cloud recommendation. Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option. Cloud exam questions reward reading the constraint carefully: the same technology can be right or wrong depending on the use case.

What to study next

Got this wrong? Here's your next step.

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Related practice questions

Related PCDOE practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free PCDOE practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this PCDOE question test?

Building and implementing CI/CD pipelines — This question tests Building and implementing CI/CD pipelines — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: In the cloudbuild.yaml, use a 'waitFor' condition that only runs the production step when the substitution variable $TAG_NAME matches 'v*.*.*'. — Option A is correct because Cloud Build supports substitution variables like $TAG_NAME, which can be used in a 'waitFor' condition or as part of a step's entrypoint logic to gate execution. By checking if $TAG_NAME matches the glob pattern 'v*.*.*', the production deployment step will only run when the build is triggered by a matching tag, ensuring environment-specific control within a single cloudbuild.yaml.

What should I do if I get this PCDOE question wrong?

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

What is the key concept behind this question?

Read the scenario before looking for a memorised answer.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Last reviewed: Jun 30, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This PCDOE practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PCDOE exam.