Created
October 12, 2017 10:41
-
-
Save daxroc/241175874e5408a15cfbd9e3563a8666 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.yaml.snakeyaml.Yaml | |
Yaml yaml = new Yaml() | |
def plugins = Jenkins.instance.pluginManager.plugins | |
def output = [] | |
def dependencies = [] | |
plugins.each { p -> | |
// println p.getProperties().toString() | |
def name = p.shortName | |
def version = p.version | |
if(!(name in dependencies)){ | |
output << ["name": name, "version": version] | |
} | |
p.dependencies.each { d -> | |
dependencies << d.shortName // d.version | |
} | |
} | |
def yml =["jenkins":["plugins": output.sort { a, b -> a.name <=> b.name } ]] | |
println yaml.dump(yml) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment