Quantcast

how can I introspect what versions of what plugins are installed?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

how can I introspect what versions of what plugins are installed?

Chris Withers
Hi All,

Where are the versions of the plugins currently installed stored?
They don't appear to be recorded anywhere in the config files..

I'm looking to have something "watch" them and record when they
change... (a bit like the job config history plugin)

cheers,

Chris

--
Simplistix - Content Management, Batch Processing & Python Consulting
             - http://www.simplistix.co.uk
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: how can I introspect what versions of what plugins are installed?

stephenconnolly
The PluginManager will tell you what plugin versions are installed and enabled, you will have to iterate it yourself.

If not running within Jenkins, i.e. doing this as an external process, you need to scan $JENKINS_HOME/plugins for the exploded directories and parse the version out of the META-INF/MANIFEST.MF files

On 21 August 2012 10:30, Chris Withers <[hidden email]> wrote:
Hi All,

Where are the versions of the plugins currently installed stored?
They don't appear to be recorded anywhere in the config files..

I'm looking to have something "watch" them and record when they change... (a bit like the job config history plugin)

cheers,

Chris

--
Simplistix - Content Management, Batch Processing & Python Consulting
            - http://www.simplistix.co.uk

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: how can I introspect what versions of what plugins are installed?

cjo9900
I was running a small groovy script to do this, and then used the trigger on start plugin to run the job when Jenkins is restarted, also gives you the enabled and pinned states so that you can see if these have changed.

Script:

import hudson.model.*
println("plugin name, version, active, enabled, pinned, URL of hpi, [dependencies]")

for(plugin in hudson.model.Hudson.instance.pluginManager.plugins) {
  def version = plugin.getVersion()
  def pinned = plugin.isPinned()
  def enabled = plugin.isEnabled()
  println("$plugin, $version, $plugin.active, $enabled, $pinned, $plugin.baseResourceURL")
  println("        $plugin.dependencies")
}


Chris

On Tuesday, August 21, 2012 11:10:08 AM UTC+1, Stephen Connolly wrote:
The PluginManager will tell you what plugin versions are installed and enabled, you will have to iterate it yourself.

If not running within Jenkins, i.e. doing this as an external process, you need to scan $JENKINS_HOME/plugins for the exploded directories and parse the version out of the META-INF/MANIFEST.MF files

On 21 August 2012 10:30, Chris Withers <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="YKGRyMkrYhMJ">ch...@...> wrote:
Hi All,

Where are the versions of the plugins currently installed stored?
They don't appear to be recorded anywhere in the config files..

I'm looking to have something "watch" them and record when they change... (a bit like the job config history plugin)

cheers,

Chris

--
Simplistix - Content Management, Batch Processing & Python Consulting
            - http://www.simplistix.co.uk

Loading...