0
0
Jenkinsdevops~5 mins

Global shared library configuration in Jenkins - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
AManage Jenkins > System Log
BManage Jenkins > Manage Plugins
CNew Item > Pipeline
DManage Jenkins > Configure System > Global Pipeline Libraries
What does the '@Library' annotation do in a Jenkins pipeline?
ASpecifies the Jenkins agent
BImports a Global Shared Library into the pipeline
CDefines a new pipeline stage
DTriggers a build
What is the 'default version' in a Jenkins Global Shared Library configuration?
AThe branch, tag, or commit used if no version is specified
BThe Jenkins version required
CThe default pipeline script
DThe default build agent
Why use Global Shared Libraries in Jenkins?
ATo increase build time
BTo disable pipeline scripts
CTo reuse code and keep pipelines consistent
DTo manage Jenkins plugins
Which source control systems can be used for Jenkins Global Shared Libraries?
AGit, Subversion, Mercurial
BOnly Git
COnly FTP servers
DOnly local files
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.