Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-58014

Parallel Build with List not working as expected

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • pipeline
    • Jenikns 2.164

      Hello,

      I am using Jenkins 2.164.1 and setting up CICD pipeline to run parallel (with sequential) in between. I am running parallel stage by passing list as input ( worked fine). But as list is huge i want to distribute the load to run the stage in chunks but in parallel. I am using collate to get the sub list but the execution happened only on first "a" and "b" and then end. Not sure why this is not working. 

      Issue : The parallel execution is working only for 1st sub list returned by .collate()

      here is sample code. 

       

      def stepsForParallel = [:]
      appBuildList =["a", "b", "c", "d","e","f","g","h","i","j"]

      for (sublist in appBuildList.collate(2, true))

      {

       sublist.each{  def stepName = "${it}"

      stepsForParallel[stepName] = { -> echo "$it" } }

       parallel stepsForParallel 

      }

            Unassigned Unassigned
            thisisgourav gourav sharma
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: