Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save techlunacy/c998e585481ad904b5a58bd23b8f9ef8 to your computer and use it in GitHub Desktop.
Save techlunacy/c998e585481ad904b5a58bd23b8f9ef8 to your computer and use it in GitHub Desktop.

Revisions

  1. techlunacy created this gist Nov 12, 2019.
    17 changes: 17 additions & 0 deletions list_all_plugins_with_updated_versions.groovy
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    import jenkins.*
    import jenkins.model.*
    import hudson.*
    import hudson.model.*
    List<String> jenkinsPlugins = new ArrayList<String>(Jenkins.instance.pluginManager.activePlugins);
    jenkinsPlugins.sort { it.displayName }

    println ""
    jenkinsPlugins.each{
    plugin -> if(plugin.getUpdateInfo()){
    println ("${plugin.getShortName()}:${plugin.getUpdateInfo().version}")

    }
    else{
    println ("${plugin.getShortName()}:${plugin.getVersion()}")
    }
    }