jenkins pipeline groovy get job available nodes -


i want know how return nodes attach specific job, , after check 1 of available.

        checkjobnodes(){      def arr[] jenkins.instance.items.findall{ job ->                  job.name =~ /automationgradle-custom/ && job.getassignedlabel() != null                }.collect { job ->                     "${job.name}: ${job.getassignedlabel().getnodes().collect({it.getnodename()==""?"master":it.getnodename()}).join(',')}\n"                }.each { slaves ->                   println slaves arr.push(slaves)               }  return arr  }  node('master'){  def jobnodes = checkjobnodes()  def avanodes = checkava()  for(i=0;i<avanodes;i++){  //some actions  } } 


Comments

Popular posts from this blog

python - Selenium remoteWebDriver (& SauceLabs) Firefox moseMoveTo action exception -

html - How to custom Bootstrap grid height? -

transpose - Maple isnt executing function but prints function term -