Choose the best description of what a Jenkins multi-branch pipeline job does.
Think about how Jenkins handles multiple branches in one job.
A multi-branch pipeline automatically detects branches in your repository and creates separate pipeline jobs for each branch, enabling parallel and independent builds.
Given the Jenkinsfile below, what will be printed when the pipeline runs on branch 'feature-xyz'?
pipeline {
agent any
stages {
stage('Print Branch') {
steps {
echo "Building branch: ${env.BRANCH_NAME}"
}
}
}
}Check the environment variable that Jenkins sets for branch name in multi-branch pipelines.
The environment variable BRANCH_NAME contains the current branch name in a multi-branch pipeline, so it prints 'feature-xyz' when building that branch.
Select the Jenkinsfile snippet that uses the correct syntax to include only branches starting with 'release/' in a multi-branch pipeline.
Look for the correct way to filter branches in Jenkinsfile using 'when' and 'branch' conditions.
The when directive with branch pattern: 'release/.*', comparator: 'REGEXP' correctly filters builds to run only on branches matching the pattern.
Order the steps to create a multi-branch pipeline job that builds branches from a GitHub repository.
Think about the logical order of creating a new job and configuring it.
You first create a new item, select multi-branch pipeline, configure the repository, then save to trigger branch scanning.
You added new branches to your GitHub repository, but Jenkins multi-branch pipeline job does not create jobs for them. What is the most likely cause?
Consider how Jenkins discovers new branches in multi-branch pipelines.
Jenkins scans the repository periodically or when manually triggered. If the scan interval is long or no manual scan is done, new branches won't be detected immediately.