4

we have jenkins project. use case:

  • jenkins triggers the build
  • slave agent builds application
  • server with slave agent goes to reboot (for any reason, for example, problem with electricity, somebody rebooted it, resource shortage and so on)

after that jenkins reports about failed build. how can we automatically relaunch application building in jenkins when slave agent recovered from failure?

1 Answer 1

3

There are two aspects to this issue -

  1. Jenkins Server needs to reschedule the build that failed
    (when the slave-machine crashed).
    • Install the Naginator Plugin
    • Set it to rebuild whatever job you have set on the problematic slave

  2. Jenkins Slave needs to restart automatically as soon as its host is up again.
    • On Windows, for example, you need to set it with a service that starts automatically

Note the Naginator Plugin doesn't know what caused the build to fail,
so it will try to rebuild any build that fails.
To solve this, scan the log for an indication that the slave crashed
and set a regular expression (in the Naginator) to catch it.

Cheers

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.