0
0
Jenkinsdevops~10 mins

Plugin compatibility considerations 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 check the installed plugin version in Jenkins.

Jenkins
def plugin_version = Jenkins.instance.pluginManager.getPlugin('[1]').version
Drag options to blanks, or click blank then click option'
Anodejs
Bpipeline
Cdocker
Dgit
Attempts:
3 left
💡 Hint
Common Mistakes
Using a plugin name that is not installed or misspelled.
2fill in blank
medium

Complete the code to list all installed plugins in Jenkins.

Jenkins
def plugins = Jenkins.instance.pluginManager.[1]()
Drag options to blanks, or click blank then click option'
AallPlugins
BgetPlugins
ClistPlugins
DinstalledPlugins
Attempts:
3 left
💡 Hint
Common Mistakes
Using a method name that does not exist in Jenkins API.
3fill in blank
hard

Fix the error in the code to check if a plugin is active.

Jenkins
def isActive = Jenkins.instance.pluginManager.[1]('git').isActive()
Drag options to blanks, or click blank then click option'
AgetPlugin
BfindPlugin
CgetPlugins
DcheckPlugin
Attempts:
3 left
💡 Hint
Common Mistakes
Using a method that returns a list instead of a single plugin.
4fill in blank
hard

Fill both blanks to create a map of plugin names and their versions.

Jenkins
def pluginMap = Jenkins.instance.pluginManager.[1]().collectEntries { [it.[2], it.version] }
Drag options to blanks, or click blank then click option'
AgetPlugins
Bname
Cversion
DgetPlugin
Attempts:
3 left
💡 Hint
Common Mistakes
Using a method that returns a single plugin for the first blank.
5fill in blank
hard

Fill all three blanks to filter plugins by version greater than 2.0 and create a map of their names and versions.

Jenkins
def filtered = Jenkins.instance.pluginManager.[1]().findAll { it.[2] > '[3]' }.collectEntries { [it.name, it.version] }
Drag options to blanks, or click blank then click option'
AgetPlugins
Bversion
C2.0
Dname
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'name' instead of 'version' for comparison.