0
0
Gitdevops~20 mins

Deployment triggers from tags in Git - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Tag Deployment Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
How do deployment triggers from tags work in CI/CD pipelines?

In a CI/CD pipeline, what is the main reason to trigger deployments based on Git tags instead of branches?

ATags automatically merge code before deployment.
BBranches are always unstable, so tags prevent any deployment.
CTags mark specific points like releases, so deployments happen only for those stable versions.
DBranches cannot trigger any pipeline jobs.
Attempts:
2 left
💡 Hint

Think about why tags are used to mark releases.

💻 Command Output
intermediate
1:30remaining
What is the output of this Git command filtering tags?

Given the following command, what will it output?

git tag --list "v1.*"

Assume the repository has tags: v1.0, v1.1, v2.0, v1.2-beta, v1.3

A
v1.0
v1.1
v1.2-beta
v1.3
Bv2.0
C
v1.0
v1.1
v1.3
DNo output
Attempts:
2 left
💡 Hint

Check how the wildcard * works in tag filtering.

Configuration
advanced
2:30remaining
Which GitLab CI configuration triggers deployment only on tags starting with 'release-'?

Choose the correct GitLab CI YAML snippet that triggers the deploy job only when a tag starts with 'release-'.

A
deploy:
  script: echo Deploying
  rules:
    - if: '$CI_COMMIT_TAG =~ /^release-.*/'
      when: always
    - when: never
B
deploy:
  script: echo Deploying
  only:
    - /^release-.*/
C
deploy:
  script: echo Deploying
  only:
    - tags
  except:
    - /^release-.*/
D
deploy:
  script: echo Deploying
  only:
    - branches
    - /^release-.*/
Attempts:
2 left
💡 Hint

Look for the syntax that supports regex matching on tags.

Troubleshoot
advanced
2:00remaining
Why does deployment not trigger on new tags in this Jenkins pipeline?

A Jenkins pipeline is configured to trigger on tags, but deployments do not start when new tags are pushed. Which is the most likely cause?

AThe Git repository has no tags.
BThe Jenkins webhook is set to trigger only on branch pushes, not tag pushes.
CTags are not supported in Jenkins pipelines.
DThe Jenkinsfile syntax is invalid and prevents any triggers.
Attempts:
2 left
💡 Hint

Check webhook settings for event types.

🔀 Workflow
expert
3:00remaining
Order the steps to set up deployment triggers from Git tags in a CI/CD pipeline

Arrange the steps in the correct order to enable deployment triggers from Git tags.

A3,2,1,4
B3,1,2,4
C1,2,3,4
D1,3,2,4
Attempts:
2 left
💡 Hint

Think about configuring before pushing tags.