Complete the code to enable branch discovery in Jenkins Multibranch Pipeline.
branchSources {
git {
id('1234')
remote('https://github.com/example/repo.git')
[1]
}
}The branchDiscovery { strategyId(2) } enables discovering all branches.
Complete the code to configure Jenkins to discover pull requests from origin.
branchSources {
git {
id('5678')
remote('https://github.com/example/repo.git')
pullRequestDiscovery {
[1]
}
}
}Strategy ID 3 discovers pull requests from origin repository only.
Fix the error in the branch discovery configuration to correctly discover branches.
branchSources {
git {
id('91011')
remote('https://github.com/example/repo.git')
branchDiscovery {
[1]
}
}
}Strategy ID 2 is the correct value to discover all branches.
Fill both blanks to configure Jenkins to discover branches and pull requests from forks.
branchSources {
git {
id('121314')
remote('https://github.com/example/repo.git')
branchDiscovery {
[1]
}
pullRequestDiscovery {
[2]
}
}
}Use strategyId 2 for branch discovery and strategyId 4 for pull requests from forks.
Fill all three blanks to configure Jenkins Multibranch Pipeline for branch discovery, origin PRs, and fork PRs.
branchSources {
git {
id('151617')
remote('https://github.com/example/repo.git')
branchDiscovery {
[1]
}
pullRequestDiscovery {
strategyId([2])
}
pullRequestDiscovery {
strategyId([3])
}
}
}Branch discovery uses strategyId 2. Pull request discovery uses strategyId 3 for origin PRs and 4 for fork PRs.