简体   繁体   中英

Is it possible to run a same jenkins build job in parallel stages in jenkins pipeline

I have a jenkin job name called A . I want this to run in parallel on different nodes in jenkins pipeline. When i try to run this, my job is in queue even when i try to run in different node.

sample code is below. I have added exact syntax of build job inside steps. For demonstration purpose i have added comments only. Thanks for help in advance

pipeline{
 agent none
   stages{
     stage("A"){
       parallel{
         stage("A1"){
            agent{
               label 'node a'
            }
            steps{
              // build job with name A
           }

         }
         stage("A2"){
            agent{
               label 'node b'
            }
            steps{
              // build job with name A
           }

         }


       }

     }

   }

}

You can add a fake parameter to the job, and then call it with different value for the parameter for each call. This will force it to call the same job twice.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM