In order to support a number of use cases, we need a way to define variables that can be accessed across different steps blocks.

      As a talking point, here's what someone was trying to do:

      pipeline {
        agent {
          node label: 'master'
        }
        stages {
          stage('Allocate workspace') {
            steps {
              script {
                def extWorkspace = exwsAllocate 'diskpool1'
              }
            }
          }
          stage('Build') {
            steps {
              parallel(
                "a": {
                  node(label: 'a') {
                    exws (extWorkspace) {
                      sh 'ls -la'
                    }
                  }
                },
                "b": {
                  node(label: 'b') {
                    exws (extWorkspace) {
                      sh 'ls -la'
                    }
                  }
                }
              )
            }
          }
        }
      }
      

          [JENKINS-43408] Provide a standardized way of dealing with variables

          Keith Zantow created issue -
          James Dumay made changes -
          Epic Link New: JENKINS-36291 [ 172300 ]
          James Dumay made changes -
          Assignee Original: James Dumay [ jamesdumay ]
          Keith Zantow made changes -
          Assignee New: Keith Zantow [ kzantow ]
          James Dumay made changes -
          Epic Link Original: JENKINS-36291 [ 172300 ] New: JENKINS-45422 [ 183590 ]
          Andrew Bayer made changes -
          Link New: This issue duplicates JENKINS-44376 [ JENKINS-44376 ]
          Andrew Bayer made changes -
          Resolution New: Duplicate [ 3 ]
          Status Original: Open [ 1 ] New: Fixed but Unreleased [ 10203 ]

            kzantow Keith Zantow
            kzantow Keith Zantow
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: