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

Select the Nth allocated workspace from the upstream job

      Currently, The upstream job may allocate multiple workspaces, by calling multiple times the exwsAllocate step. In this case, when this run is selected in the downstream job, the exwsAllocate step from the downstream job will choose the first workspace that was allocated in the upstream job.
      e.g.

      Upstream Pipeline

      // upstream job allocates workspaces from two different Disk Pools
      def extWorkspace1 = exwsAllocate 'diskpool1'
      def extWorkspace2 = exwsAllocate 'diskpool2'
      // ...
      

      Downstream Pipeline

      def run = selectRun 'upstream-job-name'
      // the downstream job will choose the first allocated workspace from the upstream job
      def extWorkspace = exwsAllocate selectedRun: run
      

      This feature allows the user to select a specific workspace that was allocated in the upstream job. For this, an extra parameter may be needed for the exwsAllocate step.
      Each allocated workspace has its own auto-generated unique id, so we can make use of that.
      e.g.

      def extWorkspace = exwsAllocate selectedRun: run, workspaceId: 'unique-workspace-id'
      

          [JENKINS-37079] Select the Nth allocated workspace from the upstream job

          Alexandru Somai created issue -
          Alexandru Somai made changes -
          Description Original: Currently, The upstream job may allocate multiple workspaces, by calling multiple times the {{exwsAllocate}} step. In this case, when this run is selected in the downstream job, the {{exwsAllocate}} step from the downstream job will choose the first workspace that was allocated in the upstream job.
          e.g.

          Upstream Pipeline
          {code}
          // upstream job allocates workspaces from two different Disk Pools
          def extWorkspace1 = exwsAllocate 'diskpool1'
          def extWorkspace2 = exwsAllocate 'diskpool2'
          // ...
          {code}

          Downstream Pipeline
          {code}
          def run = selectRun 'upstream-job-name'
          // the downstream job will choose the first allocated workspace from the upstream job
          def extWorkspace = exwsAllocate selectedRun: run
          {code}

          This feature allows the user to select a specific workspace that was allocated in the upstream job. For this, an extra parameter may be needed for the {{exwsAllocate}} step.
          Each allocated workspace has its own auto-generated unique id.
          e.g.
          {code}
          def extWorkspace = exwsAllocate selectedRun: run, workspaceId: 'unique-workspace-id'
          {code}
          New: Currently, The upstream job may allocate multiple workspaces, by calling multiple times the {{exwsAllocate}} step. In this case, when this run is selected in the downstream job, the {{exwsAllocate}} step from the downstream job will choose the first workspace that was allocated in the upstream job.
          e.g.

          Upstream Pipeline
          {code}
          // upstream job allocates workspaces from two different Disk Pools
          def extWorkspace1 = exwsAllocate 'diskpool1'
          def extWorkspace2 = exwsAllocate 'diskpool2'
          // ...
          {code}

          Downstream Pipeline
          {code}
          def run = selectRun 'upstream-job-name'
          // the downstream job will choose the first allocated workspace from the upstream job
          def extWorkspace = exwsAllocate selectedRun: run
          {code}

          This feature allows the user to select a specific workspace that was allocated in the upstream job. For this, an extra parameter may be needed for the {{exwsAllocate}} step.
          Each allocated workspace has its own auto-generated unique id, so we can make use of that.
          e.g.
          {code}
          def extWorkspace = exwsAllocate selectedRun: run, workspaceId: 'unique-workspace-id'
          {code}
          Alexandru Somai made changes -
          Epic Link New: JENKINS-37543 [ 173654 ]
          Alexandru Somai made changes -
          Assignee New: Alexandru Somai [ alexsomai ]

            alexsomai Alexandru Somai
            alexsomai Alexandru Somai
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: