Poll SCM is a Jenkins feature that checks the source code repository at regular intervals to see if there are any changes. If changes are found, it triggers a build.
Click to reveal answer
beginner
How do you configure Poll SCM in a Jenkins job?
In the job configuration, under 'Build Triggers', select 'Poll SCM' and enter a schedule using cron syntax to specify how often Jenkins should check for changes.
Click to reveal answer
intermediate
What does the cron syntax in Poll SCM schedule represent?
The cron syntax defines the timing for polling. It has five fields: minute, hour, day of month, month, and day of week. For example, 'H/15 * * * *' means every 15 minutes.
Click to reveal answer
beginner
What happens if Poll SCM finds no changes in the repository?
If no changes are detected, Jenkins does not trigger a build. It simply waits until the next scheduled poll.
Click to reveal answer
intermediate
Can Poll SCM trigger builds immediately after a commit?
No, Poll SCM triggers builds only at scheduled intervals. For immediate builds after commits, use webhooks or other trigger methods.
Click to reveal answer
What does Poll SCM do in Jenkins?
ADeploys the application to production
BAutomatically merges code branches
CChecks the source code repository for changes at set intervals
DRuns unit tests only
✗ Incorrect
Poll SCM regularly checks the source code repository for changes and triggers builds if changes are found.
Where do you enable Poll SCM in Jenkins job configuration?
AUnder 'Source Code Management'
BUnder 'Build Triggers'
CUnder 'Post-build Actions'
DUnder 'Build Environment'
✗ Incorrect
Poll SCM is enabled under the 'Build Triggers' section in Jenkins job configuration.
What does the cron expression 'H/10 * * * *' mean in Poll SCM?
APoll every 10 minutes
BPoll every hour
CPoll once a day
DPoll every 10 seconds
✗ Incorrect
The expression 'H/10 * * * *' means Jenkins polls the repository every 10 minutes.
If no changes are found during Poll SCM, what happens?
ABuild is triggered anyway
BJenkins restarts
CJenkins sends an error
DNo build is triggered
✗ Incorrect
Jenkins only triggers a build if changes are detected during Poll SCM.
Which method triggers builds immediately after a commit instead of Poll SCM?
AWebhooks
BManual build
CScheduled build
DPolling every hour
✗ Incorrect
Webhooks notify Jenkins immediately after a commit to trigger builds without waiting for polling.
Explain how Poll SCM works in Jenkins and how to configure it.
Think about how Jenkins checks for code changes regularly.
You got /4 concepts.
Describe the difference between Poll SCM and webhook triggers in Jenkins.
Consider timing and how builds start after code changes.
You got /4 concepts.
Practice
(1/5)
1.
What is the main purpose of the Poll SCM option in Jenkins?
easy
A. To send notifications when a build fails
B. To manually start a build whenever you want
C. To deploy the application automatically after every build
D. To regularly check the source code repository for changes and trigger builds if changes are found
Solution
Step 1: Understand Poll SCM function
Poll SCM is designed to check the source code repository at regular intervals for any new changes.
Step 2: Identify the trigger action
When changes are detected, Jenkins triggers a build automatically.
Final Answer:
To regularly check the source code repository for changes and trigger builds if changes are found -> Option D
Quick Check:
Poll SCM triggers builds on repo changes [OK]
Hint: Poll SCM triggers builds only when repo changes appear [OK]
Common Mistakes:
Confusing Poll SCM with manual build triggers
Thinking Poll SCM deploys code automatically
Assuming Poll SCM sends notifications
2.
Which of the following is the correct way to set a Poll SCM schedule to check every 15 minutes in Jenkins?
easy
A. */15 * * * *
B. 0 */15 * * *
C. 0 15 * * *
D. 15 * * * *
Solution
Step 1: Understand cron syntax for every 15 minutes
The syntax "*/15 * * * *" means every 15 minutes at minute 0, 15, 30, 45.
Step 2: Compare options
0 */15 * * * "0 */15 * * *" polls at minute 0 every 15 hours (e.g., 00:00, 15:00); A is standard cron for every 15 minutes; Options C and D specify fixed times, not every 15 minutes.
Final Answer:
*/15 * * * * -> Option A
Quick Check:
*/15 means every 15 minutes [OK]
Hint: Use */15 in first field for every 15 minutes polling [OK]
Common Mistakes:
Using fixed minute values instead of intervals
Putting interval */15 in the hour field instead of minute field
Setting wrong fields for minutes
3.
Given the Poll SCM schedule H/10 * * * *, what will Jenkins do?
medium
A. Poll the SCM every 10 minutes starting exactly at minute 0
B. Poll the SCM only once every hour at minute 10
C. Poll the SCM every 10 minutes starting at a random minute each hour
D. Poll the SCM every 10 seconds
Solution
Step 1: Understand Jenkins H/ syntax
The 'H' means Jenkins picks a random minute to spread load; 'H/10' means every 10 minutes starting from that random minute.
Step 2: Interpret the schedule
Jenkins polls SCM every 10 minutes but start time varies per job to avoid all jobs polling simultaneously.
Final Answer:
Poll the SCM every 10 minutes starting at a random minute each hour -> Option C
Quick Check:
H/10 means every 10 minutes from random start [OK]
Hint: H/10 means every 10 minutes from random start minute [OK]
Common Mistakes:
Thinking H/10 starts exactly at minute 0
Confusing seconds with minutes
Assuming polling happens only once per hour
4.
You set Poll SCM with schedule H/5 * * * * but Jenkins never triggers builds even when code changes. What is the most likely cause?
medium
A. The Poll SCM schedule syntax is invalid
B. The repository URL is incorrect or unreachable
C. Polling triggers builds even without changes
D. Jenkins does not support Poll SCM for Git repositories
Solution
Step 1: Check Poll SCM schedule validity
Schedule 'H/5 * * * *' is valid and means poll every 5 minutes.
Step 2: Identify why builds don't trigger
If no builds trigger despite changes, likely Jenkins cannot access the repo to detect changes.
Final Answer:
The repository URL is incorrect or unreachable -> Option B
Quick Check:
Unreachable repo stops polling builds [OK]
Hint: Check repo URL if Poll SCM triggers no builds [OK]
Common Mistakes:
Assuming Poll SCM triggers builds without changes
Blaming schedule syntax when it's correct
Thinking Jenkins can't poll Git repos
5.
You want Jenkins to poll your Git repository only during office hours (9 AM to 5 PM) every 30 minutes. Which Poll SCM schedule should you use?
hard
A. H/30 9-16 * * *
B. H/30 9-17 * * *
C. H/30 9-18 * * *
D. H/30 8-17 * * *
Solution
Step 1: Understand hour range in cron
Hours are 0-23; '9-16' covers 9:00 to 16:59 (9 AM to 4:59 PM), matching office hours 9 AM to 5 PM excluding the 5 PM hour.
Step 2: Match office hours 9 AM to 5 PM
9-16 includes up to 4:59 PM; 9-17 includes the full 5 PM hour (up to 5:59 PM).
Step 3: Confirm polling every 30 minutes
H/30 means every 30 minutes starting at a hashed minute.
Final Answer:
H/30 9-16 * * * -> Option A
Quick Check:
9-16 hours covers 9 AM to 4:59 PM [OK]
Hint: Use hour range 9-16 for 9 AM to 5 PM polling excluding 5 PM hour [OK]
Common Mistakes:
Using 9-17 which includes the 5 PM hour
Confusing hour ranges in cron syntax
Forgetting H/30 means every 30 minutes
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.