📖 Scenario: You are managing a Jenkins server that runs automated builds and deployments. To extend Jenkins functionality, you want to install plugins. However, plugins must be compatible with your Jenkins version and with each other to avoid errors.
🎯 Goal: Learn how to list installed plugins, check their versions, and verify compatibility with the Jenkins core version.
📋 What You'll Learn
Use Jenkins CLI commands to list installed plugins
Create a variable holding the Jenkins core version
Filter plugins that are incompatible with the Jenkins core version
Print the list of incompatible plugins
💡 Why This Matters
🌍 Real World
Jenkins administrators must ensure plugins are compatible with the Jenkins core to avoid build failures and security issues.
💼 Career
Knowing how to check plugin compatibility is essential for DevOps engineers managing CI/CD pipelines using Jenkins.
Progress0 / 4 steps
1
List Installed Jenkins Plugins
Use the Jenkins CLI command jenkins-cli.jar with list-plugins option and save the output to a variable called plugins_list.
Jenkins
Hint
Use backticks to capture command output in a variable.
2
Set Jenkins Core Version Variable
Create a variable called jenkins_core_version and set it to the exact string 2.387.1 representing your Jenkins core version.
Jenkins
Hint
Assign the version string exactly as shown.
3
Filter Incompatible Plugins
Create a list called incompatible_plugins by filtering plugins_list lines that contain the string incompatible or have a minimum Jenkins version higher than jenkins_core_version. Use a loop with variables plugin and details to process each line.
Jenkins
Hint
Split the plugins_list by new lines and check each line for the word 'incompatible'.
4
Print Incompatible Plugins
Print the incompatible_plugins list to display all plugins that are not compatible with the Jenkins core version.
Jenkins
Hint
Use print(incompatible_plugins) to show the list.
Practice
(1/5)
1. Why is it important to check plugin compatibility before installing a new Jenkins plugin?
easy
A. To avoid Jenkins crashes or broken functionality
B. To speed up the Jenkins build process
C. To reduce the size of Jenkins logs
D. To increase the number of available plugins
Solution
Step 1: Understand plugin compatibility risks
Plugins that are not compatible with your Jenkins version or other plugins can cause failures or crashes.
Step 2: Recognize the impact of incompatible plugins
Installing incompatible plugins may break Jenkins features or cause instability.
Final Answer:
To avoid Jenkins crashes or broken functionality -> Option A
Quick Check:
Plugin compatibility = avoid crashes [OK]
Hint: Always check compatibility to prevent Jenkins failures [OK]
Common Mistakes:
Thinking compatibility only affects performance
Ignoring plugin docs before installation
Assuming all plugins work on all Jenkins versions
2. Which Jenkins command or interface is best used to check plugin compatibility before installation?
easy
A. Editing the Jenkinsfile manually
B. Running 'jenkins-cli build' command
C. Restarting Jenkins server
D. Using the Jenkins Plugin Manager UI
Solution
Step 1: Identify how to check plugin compatibility
The Jenkins Plugin Manager UI shows plugin versions and compatibility info before installation.
Updating plugin 'git' from version 4.10.0 to 4.11.0
Warning: Plugin 'git' requires Jenkins 2.289 or higher
Current Jenkins version: 2.277.1
Update failed due to incompatible Jenkins version.
What is the main reason the update failed?
medium
A. The Jenkins version is lower than the plugin's required version
B. The plugin version is older than the current one
C. The plugin is not installed
D. The Jenkins server is offline
Solution
Step 1: Analyze the update log details
The log says the plugin requires Jenkins 2.289+, but current Jenkins is 2.277.1.
Step 2: Understand why update failed
The Jenkins version is too low to support the new plugin version, causing failure.
Final Answer:
The Jenkins version is lower than the plugin's required version -> Option A
Quick Check:
Plugin requires newer Jenkins = update fails [OK]
Hint: Check Jenkins version meets plugin minimum requirement [OK]
Common Mistakes:
Assuming plugin version downgrade caused failure
Ignoring Jenkins version requirements
Thinking plugin not installed causes update failure
4. You installed a new plugin and Jenkins fails to start. What is the best first step to fix this plugin compatibility issue?
medium
A. Delete all Jenkins plugins and reinstall Jenkins
B. Restore Jenkins from a backup made before plugin installation
C. Ignore the error and restart Jenkins multiple times
D. Upgrade Jenkins to the latest version without backup
Solution
Step 1: Identify safe recovery method
Restoring from backup before plugin install avoids data loss and fixes compatibility issues.
Step 2: Understand why other options are risky
Deleting all plugins or upgrading without backup risks data loss; ignoring errors won't fix startup.
Final Answer:
Restore Jenkins from a backup made before plugin installation -> Option B
Quick Check:
Backup restore = safe fix for plugin issues [OK]
Hint: Always backup Jenkins before plugin changes [OK]
Common Mistakes:
Skipping backups before plugin installs
Deleting plugins blindly
Ignoring startup errors hoping they resolve
5. You want to update multiple Jenkins plugins but keep Jenkins stable. Which approach best ensures plugin compatibility and system stability?
hard
A. Disable Jenkins security and update plugins simultaneously
B. Update all plugins at once without checking compatibility to save time
C. Check each plugin's compatibility, backup Jenkins, update plugins one by one, and test after each update
D. Delete old plugins before updating new ones without backups
Solution
Step 1: Plan safe plugin updates
Checking compatibility and backing up Jenkins prevents failures and data loss.
Step 2: Update plugins carefully and test
Updating one by one and testing ensures any issues are caught early and fixed.
Final Answer:
Check each plugin's compatibility, backup Jenkins, update plugins one by one, and test after each update -> Option C
Quick Check:
Stepwise update with backup = stable Jenkins [OK]
Hint: Backup and update plugins one at a time with tests [OK]
Common Mistakes:
Updating all plugins at once without checks
Ignoring backups before updates
Disabling security unnecessarily
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.