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

Cannot restrict a matrix build job to one node/label

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: matrix-project-plugin
    • Labels:
      None
    • Environment:
      Jenkins ver. 1.562
      Matrix Project Plugin 1.2
    • Similar Issues:

      Description

      Got the Matrix Job set this under Advanced: "Restrict where this project can be run" to "master"
      But when I run the Matrix only the first job runs on the Master - the rest run on any of the Slaves available

        Attachments

          Issue Links

            Activity

            Hide
            rw250155 Reiner Wirtz added a comment - - edited

            @Peter: Thak You very much for the note, that a plugin is needed for the workaround

            Show
            rw250155 Reiner Wirtz added a comment - - edited @Peter: Thak You very much for the note, that a plugin is needed for the workaround
            Hide
            shmoib Mohamed Samy added a comment -

            I was able to achieve the desired behavior where I can restrict slave jobs to run on certain labels.

            I did the following:

            1. add the "label expression" axis then add an expression that filters what machines you want to run on
              1. the problem here is that this expression will be used in the workspace name so you have to change the workspace name to avoid run issues due to strange folder names
            2. "Use custom child workspace" : specify a unique name per run using the matrix axis names as variables

             

            Show
            shmoib Mohamed Samy added a comment - I was able to achieve the desired behavior where I can restrict slave jobs to run on certain labels. I did the following: add the "label expression" axis then add an expression that filters what machines you want to run on the problem here is that this expression will be used in the workspace name so you have to change the workspace name to avoid run issues due to strange folder names "Use custom child workspace" : specify a unique name per run using the matrix axis names as variables  
            Hide
            dakang Daniel Kang added a comment -

            Mohamed Samy can you share a screen shot of your configuration? 

            Show
            dakang Daniel Kang added a comment - Mohamed Samy can you share a screen shot of your configuration? 
            Hide
            shmoib Mohamed Samy added a comment -

            Daniel Kang, here you are

            1- add the "label expression" axis 

             

            2- "Use custom child workspace" : specify a unique name per run using the matrix axis names as variables

             

            Show
            shmoib Mohamed Samy added a comment - Daniel Kang , here you are 1- add the "label expression" axis    2- "Use custom child workspace" : specify a unique name per run using the matrix axis names as variables  
            Hide
            dakang Daniel Kang added a comment -

            thank you Mohamed Samy

            Show
            dakang Daniel Kang added a comment - thank you Mohamed Samy

              People

              Assignee:
              kohsuke Kohsuke Kawaguchi
              Reporter:
              giladj Gilad Judes
              Votes:
              19 Vote for this issue
              Watchers:
              22 Start watching this issue

                Dates

                Created:
                Updated: