Single agent and step(s) for multiple parallel steps

This issue is archived. You can view it, but you can't modify it. Learn more

      I would like to be able to define a single agent and steps to "prepare" it for a series of parallel stages to run on it.  So like this

              stage('Test') {
                  agent {
                      label 'foo'
                  }
                  steps {
                      echo "prepare node for test stages"
                  }
                  parallel {
                      stage('Test 1') {
                          steps {
                              ...
                          }
                      }
                      stage('Test 2') {
                          steps {
                              ...
                          }
                      }
                      stage('Test 3') {
                          steps {
                              ...
                          }
                      }
                  }
              }

      When I try to do that I get an error:

      WorkflowScript: 176: Only one of "parallel", "stages", or "steps" allowed for stage "Test" @ line 176, column 9.
                 stage('Test') {
                 ^ 

            Assignee:
            Unassigned
            Reporter:
            Brian J Murrell
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: