0
0
Jenkinsdevops~20 mins

Build triggers (poll SCM, webhook, timer) in Jenkins - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Build Trigger Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
2:00remaining
What is the output of this Jenkinsfile snippet with a poll SCM trigger?

Given this Jenkinsfile snippet, what will Jenkins do?

pipeline {
  triggers {
    pollSCM('H/15 * * * *')
  }
  stages {
    stage('Build') {
      steps {
        echo 'Building...'
      }
    }
  }
}
AJenkins polls the source code repository every 15 minutes and triggers a build if changes are detected.
BJenkins triggers a build every 15 minutes regardless of source code changes.
CJenkins triggers a build only once when the pipeline is first created.
DJenkins triggers a build every 15 seconds regardless of source code changes.
Attempts:
2 left
💡 Hint

Poll SCM means Jenkins checks the source code for changes on a schedule.

🧠 Conceptual
intermediate
1:30remaining
Which build trigger uses a webhook to start a Jenkins build?

Choose the build trigger type that starts a Jenkins build immediately when a source code change is pushed.

ATimer trigger
BWebhook trigger
CPoll SCM trigger
DManual trigger
Attempts:
2 left
💡 Hint

Think about which trigger reacts instantly to external events.

Configuration
advanced
2:00remaining
Identify the correct cron syntax for a Jenkins timer trigger to run daily at 2:30 AM

Which of the following cron expressions correctly schedules a Jenkins timer trigger to run every day at 2:30 AM?

A2 30 * * *
B30 02 * * 1-5
C30 2 * * *
D0 2 30 * *
Attempts:
2 left
💡 Hint

Cron format is: minute hour day-of-month month day-of-week

Troubleshoot
advanced
2:30remaining
Why does a Jenkins job with poll SCM trigger never start a build?

A Jenkins job has a poll SCM trigger set to check every 10 minutes, but no builds start even after code changes. What is the most likely reason?

AThe Jenkins server cannot access the source code repository to detect changes.
BThe poll SCM trigger syntax is incorrect and causes a syntax error.
CThe timer trigger is overriding the poll SCM trigger.
DThe webhook is disabled, so builds cannot start.
Attempts:
2 left
💡 Hint

Think about network or permission issues that prevent Jenkins from checking the repository.

Best Practice
expert
3:00remaining
Which build trigger strategy is best for minimizing unnecessary builds in a busy team?

Your team pushes code frequently. You want to minimize unnecessary Jenkins builds while ensuring fast feedback on changes. Which trigger strategy is best?

AUse manual triggers only to control builds.
BUse poll SCM every minute to catch changes quickly.
CUse a timer trigger to build every hour regardless of changes.
DUse webhook triggers to start builds immediately on push events.
Attempts:
2 left
💡 Hint

Consider which trigger reacts instantly but only when needed.