Recall & Review
beginner
What is a Global Shared Library in Jenkins?
A Global Shared Library in Jenkins is a reusable set of scripts and code that can be used across multiple Jenkins pipelines to avoid duplication and promote consistency.
Click to reveal answer
beginner
How do you configure a Global Shared Library in Jenkins?
You configure it in Jenkins by going to 'Manage Jenkins' > 'Configure System' > 'Global Pipeline Libraries' section, then adding the library details like name, default version, and source code repository.
Click to reveal answer
intermediate
What is the purpose of the 'default version' in a Jenkins Global Shared Library?
The 'default version' specifies which branch, tag, or commit of the shared library repository Jenkins should use if no specific version is requested in the pipeline.
Click to reveal answer
beginner
How do you load a Global Shared Library in a Jenkins pipeline script?
You use the '@Library' annotation followed by the library name, for example:
@Library('my-shared-lib') _ This imports the library for use in the pipeline.Click to reveal answer
beginner
What are the benefits of using Global Shared Libraries in Jenkins?
Benefits include code reuse, easier maintenance, consistent pipeline logic, and faster pipeline development by sharing common functions and steps.
Click to reveal answer
Where do you configure a Global Shared Library in Jenkins?
✗ Incorrect
Global Shared Libraries are configured under 'Manage Jenkins' > 'Configure System' > 'Global Pipeline Libraries'.
What does the '@Library' annotation do in a Jenkins pipeline?
✗ Incorrect
The '@Library' annotation imports the specified Global Shared Library for use in the pipeline script.
What is the 'default version' in a Jenkins Global Shared Library configuration?
✗ Incorrect
The 'default version' tells Jenkins which version of the library to use if the pipeline does not specify one.
Why use Global Shared Libraries in Jenkins?
✗ Incorrect
Global Shared Libraries help reuse code and keep pipeline logic consistent across projects.
Which source control systems can be used for Jenkins Global Shared Libraries?
✗ Incorrect
Jenkins supports multiple source control systems like Git, Subversion, and Mercurial for shared libraries.
Explain how to set up and use a Global Shared Library in Jenkins pipelines.
Think about configuration steps and how to import the library in pipeline code.
You got /4 concepts.
Describe the benefits of using Global Shared Libraries in Jenkins and how they improve pipeline management.
Consider how sharing code helps teams and projects.
You got /4 concepts.