What is Branch Discovery in Jenkins Multibranch Pipeline?
Branch Discovery is a feature in Jenkins Multibranch Pipeline that automatically finds and manages branches in a source code repository, allowing Jenkins to build each branch separately.
Click to reveal answer
beginner
How does Jenkins discover branches in a Git repository?
Jenkins uses the Branch Discovery strategy configured in the Multibranch Pipeline job to scan the repository and find branches based on rules like including all branches or only those with pull requests.
Click to reveal answer
intermediate
What are the common Branch Discovery strategies in Jenkins?
Common strategies include: 1) Discover all branches, 2) Discover branches that are also filed as pull requests, 3) Discover only branches with open pull requests, and 4) Ignore branches.
Click to reveal answer
beginner
How do you configure Branch Discovery in Jenkins UI?
In Jenkins, go to your Multibranch Pipeline job > Configure > Branch Sources > Add Source (e.g., Git) > Under Behaviors, select 'Discover branches' and choose the desired strategy like 'All branches' or 'Branches with pull requests'.
Click to reveal answer
beginner
Why is Branch Discovery important in CI/CD pipelines?
Branch Discovery ensures Jenkins automatically detects new branches and pull requests, enabling automated builds and tests for each branch, which helps maintain code quality and speeds up development.
Click to reveal answer
What does Branch Discovery in Jenkins Multibranch Pipeline do?
ACreates new branches in the repository
BDeletes old branches from the repository
CMerges branches automatically
DAutomatically finds and manages branches in the repository
✗ Incorrect
Branch Discovery automatically finds and manages branches so Jenkins can build them.
Which Jenkins job type supports Branch Discovery?
AFreestyle Project
BMultibranch Pipeline
CMatrix Project
DPipeline Script
✗ Incorrect
Branch Discovery is a feature of Multibranch Pipeline jobs.
In Jenkins, where do you configure Branch Discovery settings?
AIn the Jenkins System Log
BIn the Global Tool Configuration
CUnder Branch Sources in Multibranch Pipeline configuration
DIn the Jenkins User Profile
✗ Incorrect
Branch Discovery is configured under Branch Sources in the Multibranch Pipeline job settings.
Which Branch Discovery strategy would you use to build only branches with open pull requests?
ADiscover only branches with open pull requests
BDiscover all branches
CIgnore branches
DDiscover branches that are also filed as pull requests
✗ Incorrect
The strategy 'Discover only branches with open pull requests' builds only those branches.
What is a benefit of using Branch Discovery in Jenkins?
AAutomatically builds new branches without manual setup
BAutomatically deletes branches after build
CAutomatically merges branches after build
DAutomatically creates branches in the repository
✗ Incorrect
Branch Discovery lets Jenkins build new branches automatically.
Explain what Branch Discovery configuration is in Jenkins and why it is useful.
Think about how Jenkins finds branches to build automatically.
You got /4 concepts.
Describe the steps to configure Branch Discovery in a Jenkins Multibranch Pipeline job.
Focus on the Jenkins UI navigation and options.
You got /5 concepts.
Practice
(1/5)
1.
What is the main purpose of branch discovery in Jenkins?
easy
A. To merge branches automatically before building
B. To manually select branches for building
C. To automatically find and build all branches in a repository
D. To delete old branches from the repository
Solution
Step 1: Understand branch discovery concept
Branch discovery is designed to find all branches automatically in a source code repository.
Step 2: Identify the purpose in Jenkins
Jenkins uses branch discovery to keep builds updated without manual intervention.
Final Answer:
To automatically find and build all branches in a repository -> Option C
Quick Check:
Branch discovery = automatic branch finding [OK]
Hint: Branch discovery means Jenkins finds branches automatically [OK]