Skip to content

Instantly share code, notes, and snippets.

@steven-terrana
Created September 10, 2019 15:06
Show Gist options
  • Save steven-terrana/1f54a8ddae551ad8f51cf66eba14dcde to your computer and use it in GitHub Desktop.
Save steven-terrana/1f54a8ddae551ad8f51cf66eba14dcde to your computer and use it in GitHub Desktop.
[Get plugins.txt] get all installed plugins and their versions in the required plugins.txt format #Jenkins
def plugins = [:]
Jenkins.instance.pluginManager.plugins.each{ plugin ->
plugins[plugin.getShortName()] = plugin.getVersion()
}
plugins.keySet().sort().each{ shortName ->
println "${shortName}:${plugins.getAt(shortName)}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment