Cher
Cher

Reputation: 2937

How to make a specific job wait for a slave indefinitely?

Problem :

A certain task often crashes the slave, which then should reboot (sometimes it doesn't). If the reboot fails, it may take a week until someone reboots the computer. Then the build which failed couldn't archive the artifacts.

Idea to solve it (if there is a better one please tell me) :

To have a task always launch after this one which checks if the artifacts failed to be made (I have a way to check it), and then wait forever until the slave becomes available again, to archive the artifacts.

I know it's possible to do such for every job, but I cannot find how to do it for a specific job.

Upvotes: 2

Views: 814

Answers (1)

michaelbahr
michaelbahr

Reputation: 4963

The best solution is to actually fix what crashes your server.

But for now you can add another job:

  1. In Jenkins create a "New Item".
  2. Make this a freestyle project.
  3. In the "Build Trigger" section, select "Build after other projects are built".
  4. Here you select the other job that causes the slave to crash.
  5. Afterwards add you monitoring-and-restart-script as a build step.

Upvotes: 2

Related Questions