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...) ?
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...) ?
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
© 2022 - 2024 — McMap. All rights reserved.