0

Currently I use the EC2 plugin with Jenkins, so when it needs more agents (slaves) it starts them up (or kills them when not needed). Up till now the agents have been configured with 2 job slots which is fine. However there is one particular job that requires the entire EC2 instance.

So, how can I block other jobs from running on an agent while this particular job is running? Normally the solution would be to filter the job to one set of special agents but I'd like to avoid creating an entirely new fleet of agents just for this one job.

Jon
  • 632
  • 6
  • 13

1 Answers1

0

You can use Run Condition plugin, https://wiki.jenkins-ci.org/display/JENKINS/Run+Condition+Plugin to disable any other jobs based on the fact that a particular job is running. You can find out how to get the currently running job info here, https://stackoverflow.com/questions/7285891/determine-if-given-job-is-currently-running-using-hudson-jenkins-api.

postoronnim
  • 115
  • 5
  • That is a very interesting plugin, unfortunately that doesn't work in my case. We have 50 something jobs in our Jenkins and I can't stop the rest because one job is running. Also that still wouldn't assure our job ran on it's own (could be started on an instance with another job already running). Thanks though! – Jon Mar 29 '17 at 17:25
  • You can make a requirement global by using the Configuration Slicing plugin. https://wiki.jenkins-ci.org/display/JENKINS/Configuration+Slicing+Plugin – postoronnim Mar 29 '17 at 17:28