0
0
Jenkinsdevops~10 mins

Library versioning in Jenkins - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to load a shared library with a specific version in Jenkins pipeline.

Jenkins
def lib = library('[1]')
Drag options to blanks, or click blank then click option'
Amy-shared-lib@latest
Bmy-shared-lib@v1.0
Cmy-shared-lib
Dmy-shared-lib@master
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting to specify the version after '@'.
Using 'latest' as a version tag when it is not defined.
2fill in blank
medium

Complete the code to declare a shared library with a specific version in Jenkinsfile.

Jenkins
@Library('[1]') _
Drag options to blanks, or click blank then click option'
Autils@v2.1
Butils
Cutils@master
Dutils@latest
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting the version tag after '@'.
Using 'latest' when the version is not defined.
3fill in blank
hard

Fix the error in the code to load version 'v3.0' of the shared library named 'common-lib'.

Jenkins
def common = library('[1]')
Drag options to blanks, or click blank then click option'
Acommon-lib@v3.0
Bcommon-lib:v3.0
Ccommon-lib-v3.0
Dcommon-lib#v3.0
Attempts:
3 left
💡 Hint
Common Mistakes
Using ':' or '#' instead of '@' to specify version.
Concatenating version without any separator.
4fill in blank
hard

Fill both blanks to declare and load a shared library named 'build-tools' with version 'v1.5' in Jenkins pipeline.

Jenkins
@Library('[1]') _
def tools = library('[2]')
Drag options to blanks, or click blank then click option'
Abuild-tools@v1.5
Bbuild-tools
Cbuild-tools@latest
Dbuild-tools@master
Attempts:
3 left
💡 Hint
Common Mistakes
Using unversioned library name in one place and versioned in another.
Omitting '@' in either declaration or load.
5fill in blank
hard

Fill all three blanks to load a shared library named 'deploy-lib' with version 'v2.0', then call its 'deployApp' function.

Jenkins
@Library('[1]') _
def deploy = library('[2]')
deploy.[3]()
Drag options to blanks, or click blank then click option'
Adeploy-lib@v2.0
CdeployApp
Ddeploy-lib
Attempts:
3 left
💡 Hint
Common Mistakes
Using unversioned library name in declaration or load.
Calling a function name that does not exist in the library.