Recall & Review
beginner
What is a Jenkinsfile?
A Jenkinsfile is a text file that contains the pipeline code for Jenkins to automate tasks like building, testing, and deploying software.
Click to reveal answer
beginner
Why use a Jenkinsfile per branch?
Using a Jenkinsfile per branch lets each branch have its own pipeline steps, so you can test or deploy differently depending on the branch.
Click to reveal answer
intermediate
How does Jenkins decide which Jenkinsfile to use when building a branch?
Jenkins checks out the branch code and uses the Jenkinsfile found in that branch's root directory to run the pipeline.
Click to reveal answer
intermediate
What is a simple way to test different Jenkinsfiles for different branches?
Create a Jenkinsfile in each branch with the specific pipeline steps you want, then Jenkins will run the pipeline from that file when building that branch.
Click to reveal answer
beginner
Can you use a shared Jenkinsfile for all branches instead of one per branch?
Yes, you can use one Jenkinsfile for all branches, but using one per branch gives more flexibility to customize pipelines per branch.
Click to reveal answer
What does Jenkins use to run a pipeline for a specific branch?
✗ Incorrect
Jenkins uses the Jenkinsfile found in the checked-out branch to run the pipeline.
Why might you want a different Jenkinsfile per branch?
✗ Incorrect
Different branches can have different pipeline needs, so separate Jenkinsfiles allow customization.
If you add a Jenkinsfile only to the main branch, what happens when Jenkins builds a feature branch without a Jenkinsfile?
✗ Incorrect
Jenkins looks for a Jenkinsfile in the branch; if missing, the pipeline cannot run.
How can you manage common pipeline steps across branches while using Jenkinsfile per branch?
✗ Incorrect
Shared libraries let you reuse code while keeping branch-specific Jenkinsfiles.
What is the best practice for storing Jenkinsfiles in a Git repository?
✗ Incorrect
Jenkins expects the Jenkinsfile in the root of the branch's code to run pipelines.
Explain how Jenkins uses Jenkinsfiles when building different branches in a Git repository.
Think about how Jenkins finds and runs pipeline code per branch.
You got /4 concepts.
Describe the advantages of having a Jenkinsfile per branch compared to a single Jenkinsfile for all branches.
Consider why branches might need different automation steps.
You got /4 concepts.