Hi,

I found a small groovy script to install automatically a set of plugins 
(including their dependencies):
def pluginParameter="ldap matrix-auth ssh-credentials"
def plugins = pluginParameter.split()
def instance = Jenkins.getInstance()
def pluginManager = instance.getPluginManager()
def updateCenter = instance.getUpdateCenter()
def installed = false

plugins.each {
  if (!pluginManager.getPlugin(it)) {
    def plugin = updateCenter.getPlugin(it)
    if (plugin) {
      println("Installing " + it)
      def installationJob = plugin.deploy()
      installed = true
    }
  }
}

instance.save()
if (installed)
  instance.doSafeRestart()

I want to wait that plugins are effectively installed before proceeding 
with next instruction of the script. Plugin installation is asynch task. I 
tried to use plugin.deploy.get() as deploy() returns a Future but the 
script ends before all plugins and dependencies are effectively installed. 
Is there a way to wait until plugins and dependencies are effectively 
installed?

Regards,
Christophe

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/b30d537a-a653-4ded-b5eb-8d11ce43edf4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to