D. The job triggers when the 'BuildApp' job completes successfully
Solution
Step 1: Understand the upstream trigger
The upstream trigger starts this job when the specified upstream job finishes with the given result.
Step 2: Analyze the parameters
upstreamProjects: 'BuildApp' means the job named 'BuildApp' triggers this job. threshold SUCCESS means only on successful completion.
Final Answer:
The job triggers when the 'BuildApp' job completes successfully -> Option D
Quick Check:
Upstream job success triggers downstream [OK]
Hint: Upstream triggers run after specified job success [OK]
Common Mistakes:
Thinking it triggers every minute
Confusing upstream with SCM polling
Assuming manual trigger only
4. Identify the error in this Jenkins pipeline trigger configuration:
triggers {
cron('0 25 * * *')
}
medium
A. The hour field '25' is invalid in cron syntax
B. The cron syntax is correct and will run at 25 minutes past midnight
C. The cron directive should be inside a steps block
D. The cron string must have six fields, not five
Solution
Step 1: Check cron field ranges
Cron fields are minute (0-59), hour (0-23), day, month, weekday. '25' in hour field is invalid.
Step 2: Validate placement and field count
Cron is correctly placed in triggers and uses five fields, which is standard in Jenkins.
Final Answer:
The hour field '25' is invalid in cron syntax -> Option A
Quick Check:
Hour must be 0-23 in cron [OK]
Hint: Hour in cron must be 0-23, not 25 [OK]
Common Mistakes:
Assuming cron has six fields
Placing cron inside steps block
Thinking 25 means 25 minutes
5. You want a Jenkins job to run every 15 minutes but only if there are changes in the source code repository. Which triggers directive setup achieves this?
hard
A. triggers { cron('*/15 * * * *') }
B. triggers { pollSCM('H/15 * * * *') }
C. triggers { upstream(upstreamProjects: 'RepoUpdate', threshold: hudson.model.Result.SUCCESS) }
D. triggers { pollSCM('0 0 * * *') }
Solution
Step 1: Understand pollSCM usage
pollSCM triggers the job every specified interval but only if SCM changes are detected.
Step 2: Analyze the cron expressions
'H/15 * * * *' means every 15 minutes with hashing for load balancing. cron triggers regardless of SCM changes.
Final Answer:
triggers { pollSCM('H/15 * * * *') } -> Option B
Quick Check:
pollSCM runs on changes every 15 minutes [OK]
Hint: Use pollSCM with 'H/15 * * * *' for change-based 15-min trigger [OK]
Common Mistakes:
Using cron which triggers regardless of changes
Confusing upstream trigger with SCM polling
Setting pollSCM to wrong cron expression
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.