I have added many plugins to Jenkins. How can I list the plugins and dependencies? Which plugins depend on which ones? Which ones are orphaned or unused, etc.
Ideally, explain how to make a graph (graphviz/dot...) ?
From the Jenkins home page: Click Manage Jenkins. Click Manage Plugins. Click on the Installed tab.
From the web UI Navigate to the Manage Jenkins > Manage Plugins page in the web UI. Click on the Advanced tab.
How many Jenkins Plugins are there? The 1,700+ plugins encompass source code management, administration, platforms, UI/UX, building management, and much more.
Copy-paste this groovy snippet to get a list of plugins (this snippet based on this exemple from zendesk.com):
Note: the groovy must be pasted in _Manage Jenkins >> Script Console
def plugins = jenkins.model.Jenkins.instance.getPluginManager().getPlugins()
plugins.each {
println "${it.getShortName()} (${it.getVersion()}) => ${it.getDependencies()}"
}
To produce a graph, execute this snippet to generate a DOT graph (graphviz) file...
def plugins = jenkins.model.Jenkins.instance.getPluginManager().getPlugins()
println "digraph test {"
plugins.each {
def plugin = it.getShortName()
println "\"${plugin}\";"
def deps = it.getDependencies()
deps.each {
def s = it.shortName
println "\"${plugin}\" -> \"${s}\";"
}
}
println "}"
Then use graphviz to generate an image from the output above:
dot -Tsvg plugins.txt > plugins.svg
dot -Tpng plugins.txt > plugins.png
Or copy-paste the output in one of the Graphviz: Online tool capable of accepting larger files
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With