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

Select the Nth allocated workspace from the upstream job

XMLWordPrintable

      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'
      

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

              Created:
              Updated: