0
0
Jenkinsdevops~5 mins

Why shared libraries reduce duplication in Jenkins - Quick Recap

Choose your learning style9 modes available
Recall & Review
beginner
What is a shared library in Jenkins?
A shared library in Jenkins is a collection of reusable code that can be used across multiple Jenkins pipelines to avoid rewriting the same code.
Click to reveal answer
beginner
How do shared libraries help reduce code duplication?
They centralize common code in one place, so pipelines can call the shared code instead of copying it, reducing repetition and errors.
Click to reveal answer
intermediate
What is one benefit of reducing duplication with shared libraries?
It makes maintenance easier because fixing or updating code in the shared library updates all pipelines using it automatically.
Click to reveal answer
beginner
Give an example of code that might be put in a Jenkins shared library.
Common tasks like sending notifications, checking out code, or running tests can be put in shared libraries to reuse in many pipelines.
Click to reveal answer
intermediate
Why is using shared libraries better than copying code between pipelines?
Copying code causes duplication, which leads to more errors and harder updates. Shared libraries keep code DRY (Don't Repeat Yourself).
Click to reveal answer
What is the main purpose of Jenkins shared libraries?
ATo backup Jenkins configurations
BTo store pipeline logs
CTo create new Jenkins users
DTo reuse code across multiple pipelines
How does a shared library reduce errors in Jenkins pipelines?
ABy centralizing code so fixes apply everywhere
BBy increasing the number of pipeline copies
CBy hiding pipeline logs
DBy creating more pipeline jobs
Which of these is a good candidate for a shared library function?
ASending build notifications
BWriting pipeline-specific business logic
CStoring pipeline credentials
DCreating Jenkins users
What problem does code duplication cause in Jenkins pipelines?
AFaster pipeline execution
BHarder maintenance and more bugs
CMore storage space for logs
DBetter user management
What does DRY stand for in software development?
ADevelop Reusable YAML
BDebugging Requires You
CDon't Repeat Yourself
DDeploy Rapidly Yesterday
Explain how Jenkins shared libraries help reduce code duplication and why this is beneficial.
Think about how fixing one place can update many pipelines.
You got /4 concepts.
    Describe a real-life example where using a shared library in Jenkins would save time and effort.
    Imagine you have many pipelines that do the same steps.
    You got /5 concepts.