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

Use one agent for parallel stages

XMLWordPrintable

      When using top-level agent definition parallel steps running fine as separate processes on the same agent, but when using top-level "agent none" and trying to set agent for a stage which has 2 parallel stages defined getting the error:

       

      "agent" is not allowed in stage "Test" as it contains parallel stages

      What the difference? I want to be able to run parallel stages on one agent defined not on the top level.

       

       

      pipeline {
          agent none
          
          stages {
              stage('Test') {
                  agent { label "agent1" }
                  parallel {
                      stage('Build1') {
                          steps {
                              echo "Test Build1"
                          }
                      }
                      stage('Build2') {
                          steps {
                              echo "Test Build2"
                          }
                      }
                          
                  }
              }
          }
      }
      

            Unassigned Unassigned
            trane9991 Taras Postument
            Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: