Challenge - 5 Problems
Triggers Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
What is the effect of this Jenkins pipeline triggers directive?
Consider this Jenkins pipeline snippet:
What does this trigger configuration do?
triggers {
cron('H 4/4 * * 1-5')
}What does this trigger configuration do?
Jenkins
triggers {
cron('H 4/4 * * 1-5')
}Attempts:
2 left
💡 Hint
Remember that 'H' is a hash-based random minute, and '4/4' means every 4 hours starting at hour 4.
✗ Incorrect
The cron expression 'H 4/4 * * 1-5' means the job runs at a hashed minute (H), every 4 hours starting at hour 4, on weekdays (1-5). So it runs every 4 hours on Monday to Friday.
🧠 Conceptual
intermediate1:30remaining
Which Jenkins trigger directive starts a build when a GitHub push event occurs?
You want your Jenkins pipeline to start automatically when someone pushes code to GitHub. Which trigger directive should you use?
Attempts:
2 left
💡 Hint
Think about triggers that respond to external events rather than time schedules.
✗ Incorrect
The 'githubPush()' trigger listens for GitHub push events and starts the build immediately when code is pushed.
❓ Troubleshoot
advanced2:00remaining
Why does this Jenkins pipeline not trigger as expected?
Given this Jenkins pipeline snippet:
The job does not start automatically even though the repository has new commits. What is the most likely cause?
triggers {
pollSCM('H/15 * * * *')
}The job does not start automatically even though the repository has new commits. What is the most likely cause?
Jenkins
triggers {
pollSCM('H/15 * * * *')
}Attempts:
2 left
💡 Hint
Consider how pollSCM works compared to event-driven triggers.
✗ Incorrect
pollSCM schedules Jenkins to check the repository every 15 minutes. It does not trigger builds immediately on commit; if polling misses changes or is delayed, builds may not start instantly.
🔀 Workflow
advanced2:00remaining
How to configure a Jenkins pipeline to trigger after another job completes successfully?
You want your Jenkins pipeline to start only after another job named 'Build-App' finishes successfully. Which triggers directive achieves this?
Attempts:
2 left
💡 Hint
Look for a trigger that listens to other job completions.
✗ Incorrect
The 'upstream' trigger listens for the completion of another job. Specifying 'SUCCESS' means it triggers only if the upstream job finishes successfully.
✅ Best Practice
expert2:30remaining
What is the best practice for using the triggers directive to avoid unnecessary builds?
Which approach best reduces unnecessary Jenkins builds when using triggers in pipelines?
Attempts:
2 left
💡 Hint
Think about balancing responsiveness and resource use.
✗ Incorrect
Event-driven triggers like githubPush() start builds immediately on changes, reducing unnecessary polling. Minimal polling can catch missed events, balancing load and responsiveness.