Complete the code to trigger branch indexing in a Jenkins Pipeline.
properties([pipelineTriggers([[1]('H/5 * * * *')])])
The pollSCM trigger tells Jenkins to check the source control for new branches or changes, which triggers branch indexing.
Complete the code to scan all branches in a Multibranch Pipeline job.
multibranchPipelineJob('example') { branchSources { git { id('1234') remote('https://github.com/example/repo.git') } } [1] { cron('H * * * *') } }
The scanTriggers block configures how Jenkins scans branches in a Multibranch Pipeline job.
Fix the error in the Jenkinsfile to correctly scan branches every 15 minutes.
multibranchPipelineJob('example') { scanTriggers { cron('[1]') } }
The H/15 * * * * syntax tells Jenkins to run the scan every 15 minutes with a hashed start time to spread load.
Fill both blanks to configure branch indexing to exclude branches matching a pattern and to set the scan interval.
multibranchPipelineJob('example') { branchSources { git { remote('https://github.com/example/repo.git') [1]('feature/*') } } scanTriggers { cron('[2]') } }
excludeBranches('feature/*') tells Jenkins to skip branches starting with 'feature/'. The cron H/10 * * * * sets scanning every 10 minutes.
Fill all three blanks to create a Jenkinsfile snippet that scans branches, includes only 'main' and 'release/*' branches, and triggers scanning every 20 minutes.
multibranchPipelineJob('example') { branchSources { git { remote('https://github.com/example/repo.git') [1]('main') [2]('release/*') } } scanTriggers { cron('[3]') } }
Using includeBranches twice specifies which branches to scan. The cron H/20 * * * * triggers scanning every 20 minutes.