Created
February 25, 2012 06:51
-
-
Save kellyrob99/1907114 to your computer and use it in GitHub Desktop.
Jenkins/Hudson recipe for updating all Plugins using the CLI
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
def findPluginsWithUpdates = ''' | |
Hudson.instance.pluginManager.plugins.inject([]) { List toUpdate, plugin -> | |
if(plugin.hasUpdate()) | |
{ | |
toUpdate << plugin.shortName | |
} | |
toUpdate | |
}.inspect() | |
''' | |
OutputStream updateablePlugins = new ByteArrayOutputStream() | |
cliApi.runCliCommand(rootUrl, ['groovysh', findPluginsWithUpdates], System.in, updateablePlugins, System.err) | |
def listOfPlugins = Eval.me(parseOutput(updateablePlugins.toString())) | |
listOfPlugins.each{ plugin -> | |
cliApi.runCliCommand(rootUrl, ['install-plugin', plugin]) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment