patternMinor
Restart agent for each build
Viewed 0 times
restarteachagentforbuild
Problem
How do I configure jenkins to restart the agent for each build?
I tried to use "launch method: launch agent via execution of command on the master" in combintation with "availability: take this agent online when in demand, and offline when idle" but it has two drawbacks:
There is even a plugin (scripted cloud plugin) that, according to the description, should be suitable, but it does not work, probably because its code is outdated.
I tried to use "launch method: launch agent via execution of command on the master" in combintation with "availability: take this agent online when in demand, and offline when idle" but it has two drawbacks:
- (not critical) build starts with a delay of about one minute.
- (critical) the node goes offline only a minute after the end of the build, and if another build starts at that time, the same still running agent will be used (even if there are several similarly configured free nodes).
There is even a plugin (scripted cloud plugin) that, according to the description, should be suitable, but it does not work, probably because its code is outdated.
Solution
Slave restarts the agent itself after each build? You can use Conditional BuildStep plugin to restart it on a defined condition.
Context
StackExchange DevOps Q#4811, answer score: 2
Revisions (0)
No revisions yet.