Class RetryableDeclarativeAgent<A extends RetryableDeclarativeAgent<A>>
java.lang.Object
hudson.model.AbstractDescribableImpl<T>
org.jenkinsci.plugins.pipeline.modeldefinition.withscript.WithScriptDescribable<A>
org.jenkinsci.plugins.pipeline.modeldefinition.agent.DeclarativeAgent<A>
org.jenkinsci.plugins.pipeline.modeldefinition.agent.RetryableDeclarativeAgent<A>
- All Implemented Interfaces:
ExtensionPoint
,Describable<A>
,Serializable
public abstract class RetryableDeclarativeAgent<A extends RetryableDeclarativeAgent<A>>
extends DeclarativeAgent<A>
A type of
agent
option that supports automatic retries.
Usage from your DeclarativeAgentScript.run(groovy.lang.Closure)
would look something like:
Closure run = {
script.node {
CheckoutScript.doCheckout(script, describable, null, body).call()
}
}
if (describable.retries > 1) {
return {
script.retry(count: describable.retries, conditions: [script.agent(), script.nonresumable()]) {
run.call()
}
}
} else {
run
}
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jenkinsci.plugins.pipeline.modeldefinition.agent.DeclarativeAgent
DeclarativeAgent.CheckoutScriptAllowlist
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Field Summary
Fields inherited from class org.jenkinsci.plugins.pipeline.modeldefinition.agent.DeclarativeAgent
doCheckout, inStage, subdirectory
-
Constructor Summary
-
Method Summary
Methods inherited from class org.jenkinsci.plugins.pipeline.modeldefinition.agent.DeclarativeAgent
copyFlags, getDescriptor, getScript, getSubdirectory, hasScmContext, initialize, isDoCheckout, isInStage, reuseRootAgent, setDoCheckout, setInStage, setSubdirectory
-
Constructor Details
-
RetryableDeclarativeAgent
public RetryableDeclarativeAgent()
-
-
Method Details
-
getRetries
public int getRetries() -
setRetries
@DataBoundSetter public void setRetries(int retries)
-