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

Unable to set number of executors on slave through Groovy system script

XMLWordPrintable

      I would like to set the number of executors on a slave node in a build step. I tried doing that with a Groovy system script, but it seems to me this is not possible, since the setNumExecutors(int) method is only implemented by jenkins.model.Jenkins, which will however only affect the master node. The method is not accessible through the 'Node', 'Slave' or 'Computer' classes, which would allow me to do that on a slave. For example, like this

      Hudson.instance.getComputer("SlaveName").setNumExecutors(1)

            vjuranek vjuranek
            dengste David Engster
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: