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

job-restrictions Job Property does not support Pipeline Plugin

    XMLWordPrintable

Details

    Description

      job-restrictions-plugin does not support Pipeline Plugin (aka Workflow plugin) and it's behavior is not as expected.

      Steps to reproduce it:

      Create a job using Pipeline Plugin (https://wiki.jenkins-ci.org/display/JENKINS/Pipeline+Plugin)
      Create a slave in your master called for example 'demo-slave'.

      In your Groovy script using pipeline do:

      node('master') {

      }

      node('demo-slave') {

      }

      After in 'demo-slave' configuration, restrict it:

      No matter if you start your job with 'daniel_hernandez' user or other user, the job will not get a executor from the demo-slave node getting the message:

      Waiting for next available executor on demo-slave

      After, You can release it setting the value to 'Take any job'

      Attachments

        1. Captura.PNG
          Captura.PNG
          18 kB
        2. job-restrictions.hpi
          62 kB
        3. screenshot-1.png
          screenshot-1.png
          5 kB

        Issue Links

          Activity

            oleg_nenashev Oleg Nenashev added a comment -

            No update. The described use-case can be rather done by Authorize Project and user roles  in matrix-auth/role-strategy

            oleg_nenashev Oleg Nenashev added a comment - No update. The described use-case can be rather done by Authorize Project and user roles  in matrix-auth/role-strategy

            Hmm ok, I will check into that. I was hoping to restrict this at the node level. I'm not entirely sure how to achieve this with that plugin, but maybe I missed something.

            mtdeguzis Michael DeGuzis added a comment - Hmm ok, I will check into that. I was hoping to restrict this at the node level. I'm not entirely sure how to achieve this with that plugin, but maybe I missed something.

            I don't really see a way to restrict nodes with Authorize Project. Any notes on that or a post that describes that?

            mtdeguzis Michael DeGuzis added a comment - I don't really see a way to restrict nodes with Authorize Project. Any notes on that or a post that describes that?

            I do not see the way how to do it in role-strategy as well. I need to restrict execution on certain Agents for certain people or groups and it is not possible to achieve it in standard authorisation method. In role-strategy I am able to not to allow build for certain group or people, but I want them to execute builds, but not on all agents

            lacot5 Ladislav Toldy added a comment - I do not see the way how to do it in role-strategy as well. I need to restrict execution on certain Agents for certain people or groups and it is not possible to achieve it in standard authorisation method. In role-strategy I am able to not to allow build for certain group or people, but I want them to execute builds, but not on all agents

            I have tried the version in attachment, job-restrictions.hpiand it works for my use case thanks mansoor, solving my problems (restrict execution only for certain groups). Build termination was not requested in this ticket, is there a vision of releasing this fix officially?

            lacot5 Ladislav Toldy added a comment - I have tried the version in attachment, job-restrictions.hpi and it works for my use case thanks mansoor , solving my problems (restrict execution only for certain groups). Build termination was not requested in this ticket, is there a vision of releasing this fix officially?

            People

              mansoor Mansoor Saqib
              daniel_alejandro_hc Daniel Hernandez
              Votes:
              21 Vote for this issue
              Watchers:
              25 Start watching this issue

              Dates

                Created:
                Updated: