title: Run Jenkins stage on different nodes
body: <p>I have the following Jenkinsfile of a multibranch pipeline architecture </p>
  
  <pre class="lang-groovy prettyprint-override"><code>#!/usr/bin/groovy
  
  pipeline {
      agent {
          node {
              label 'ubuntu'
              customWorkspace "/src/$BUILD_NUMBER"
          }
      }
      environment {
          SRC_DIR = "$WORKSPACE"
          BUILD_DIR="/build/$BUILD_NUMBER"
      }
  
      stages {
          stage('Build') {
              steps {
                  dir(BUILD_DIR) {
                      sh '$SRC_DIR/build.sh'
                  }
              }
          }
  
          stage('Test') {
              steps {
                  dir(BUILD_DIR) {
                     sh '$SRC_DIR/test.sh'
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p>I am trying to run the 'Build' stage on Ubuntu and Red Hat nodes in parallel, and the 'Test' stage on the Ubuntu node only. </p>
  
  <p>Can anybody help me in specifying how to choose which stage are run on which nodes. I found few solutions online but they recommended rewriting the build stage twice: once for the Red Hat node and the other for the Ubuntu node. Isn't there a way to do this without code duplication ? </p>
  
  <p>Thank you very much</p>