Chanan Berler
Chanan Berler

Reputation: 79

Jenkins how to list all installed plugins, their version and latest update version

Part of Jenkins housekeeping, I am looking for a way to list all installed Jenkins plugins with current version and latest version. I have the following code which shows all Jenkins plugins and their version, but it down not show the latest version available.

def pluginList = new ArrayList(Jenkins.instance.pluginManager.plugins)
pluginList.sort { it.getShortName() }.each{
  plugin -> 
    println ("${plugin.getDisplayName()} (${plugin.getShortName()}): ${plugin.getVersion()}")
}

Upvotes: 2

Views: 2119

Answers (1)

ycr
ycr

Reputation: 14574

Check the following script.

def pluginList = new ArrayList(Jenkins.instance.pluginManager.plugins)

pluginList.sort { it.getShortName() }.each{
  plugin -> 
    println ("${plugin.getDisplayName()} (${plugin.getShortName()}): ${plugin.getVersion()} : ${plugin.hasUpdate() ? plugin.getUpdateInfo().version : 'No Update'}")
}

Upvotes: 1

Related Questions