Given this Jenkinsfile snippet, what will Jenkins do?
pipeline {
triggers {
pollSCM('H/15 * * * *')
}
stages {
stage('Build') {
steps {
echo 'Building...'
}
}
}
}Poll SCM means Jenkins checks the source code for changes on a schedule.
The pollSCM('H/15 * * * *') trigger tells Jenkins to check the source code repository every 15 minutes. It only triggers a build if it finds new changes.
Choose the build trigger type that starts a Jenkins build immediately when a source code change is pushed.
Think about which trigger reacts instantly to external events.
A webhook trigger listens for events from the source code system and starts a build immediately when a change is pushed.
Which of the following cron expressions correctly schedules a Jenkins timer trigger to run every day at 2:30 AM?
Cron format is: minute hour day-of-month month day-of-week
The correct cron expression is 30 2 * * * which means at minute 30, hour 2, every day.
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?
Think about network or permission issues that prevent Jenkins from checking the repository.
If Jenkins cannot reach the source code repository, it cannot detect changes and will not trigger builds even if poll SCM is configured.
Your team pushes code frequently. You want to minimize unnecessary Jenkins builds while ensuring fast feedback on changes. Which trigger strategy is best?
Consider which trigger reacts instantly but only when needed.
Webhook triggers start builds immediately only when code is pushed, avoiding unnecessary builds and providing fast feedback.