Jenkins – How to run one housekeeping job on all nodes (slaves + master)

Jenkins

I have Jenkins setup of 6 Slaves and master, all windows machines. Now I have a housekeeping Jenkins job which I want to periodically run on all the slaves and master, as this job does following tasks

  • Delete unused temporary files.
  • Delete unwanted processes, as some of the tests are leaking processes (why leak is different question).
  • Set certain environment variables, as sometimes I want to push environment variable changes to all machines.

Any idea how can I force Jenkins to run this one job on all slaves and master once every day? As a work around I can create multiple Jenkins job and mark each one to run on one particular slave or master, but I would rather avoid having so many duplicate jobs.

Best Answer

The Node and Label Parameter plugin allows you to parameterize where a job should be run. The job can be run on more than one node -- each node shows up as a separate execution in the job's build history. When multiple nodes are selected, you can configure whether the job should continue to run on other nodes if an execution fails.

Related Topic