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 ofagent
option that supports automatic retries. Usage from yourDeclarativeAgentScript.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:
- Serialized Form
-
-
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
Constructors Constructor Description RetryableDeclarativeAgent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getRetries()
void
setRetries(int retries)
-
Methods inherited from class org.jenkinsci.plugins.pipeline.modeldefinition.agent.DeclarativeAgent
copyFlags, getDescriptor, getScript, getSubdirectory, hasScmContext, initialize, isDoCheckout, isInStage, reuseRootAgent, setDoCheckout, setInStage, setSubdirectory
-
-