3. Given this Jenkins pipeline snippet, what will trigger the build?
triggers {
pollSCM('H/15 * * * *')
}
medium
A. Build runs only if SCM changes detected every 15 minutes
B. Build runs every 15 minutes regardless of changes
C. Build runs once daily at 15 minutes past midnight
D. Build runs immediately after a webhook event
Solution
Step 1: Understand pollSCM with 'H/15 * * * *'
This means Jenkins checks the SCM every 15 minutes for changes.
Step 2: Determine when build triggers
Build triggers only if changes are detected during these checks, not every 15 minutes automatically.
Final Answer:
Build runs only if SCM changes detected every 15 minutes -> Option A
Quick Check:
pollSCM triggers on changes every 15 mins [OK]
Hint: pollSCM triggers only on changes, not just time [OK]
Common Mistakes:
Assuming build runs every 15 minutes regardless
Confusing pollSCM with timer trigger
Thinking webhook triggers are involved here
4. A Jenkins job with this trigger configuration does not start builds as expected:
triggers {
pollSCM('H/5 * * * *')
}
What is the most likely cause?
medium
A. Timer trigger conflicts with pollSCM
B. The cron syntax 'H/5 * * * *' is invalid
C. Webhook is required for pollSCM to work
D. SCM polling is disabled in Jenkins global settings
Solution
Step 1: Check pollSCM prerequisites
pollSCM requires SCM polling enabled globally in Jenkins settings.
Step 2: Validate other options
Syntax 'H/5 * * * *' is valid; webhook is separate trigger; no conflict with timer here.
Final Answer:
SCM polling is disabled in Jenkins global settings -> Option D
Quick Check:
pollSCM needs global SCM polling enabled [OK]
Hint: pollSCM needs global SCM polling enabled [OK]
Common Mistakes:
Assuming cron syntax is wrong
Thinking webhook is mandatory for pollSCM
Believing timer conflicts cause failure
5. You want Jenkins to build your project automatically every weekday at 6 AM and also immediately when code is pushed to GitHub. Which trigger setup is best?
hard
A. Use only pollSCM with cron '0 6 * * 1-5'
B. Use webhook only without timer
C. Use timer trigger '0 6 * * 1-5' and configure GitHub webhook
D. Use pollSCM every minute
Solution
Step 1: Understand requirements
Build at 6 AM weekdays and immediately on GitHub push means two triggers needed: timer and webhook.
Step 2: Evaluate options
Use timer trigger '0 6 * * 1-5' and configure GitHub webhook combines timer for scheduled build and webhook for instant build on push, fulfilling both needs.
Final Answer:
Use timer trigger '0 6 * * 1-5' and configure GitHub webhook -> Option C
Quick Check:
Timer + webhook = scheduled + instant builds [OK]
Hint: Combine timer and webhook for schedule plus instant build [OK]
Common Mistakes:
Using only pollSCM misses instant build
Using webhook alone misses scheduled build
Polling every minute is inefficient
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.