Class DeclarativeAgent<A extends DeclarativeAgent<A>>
- java.lang.Object
-
- hudson.model.AbstractDescribableImpl<T>
-
- org.jenkinsci.plugins.pipeline.modeldefinition.withscript.WithScriptDescribable<A>
-
- org.jenkinsci.plugins.pipeline.modeldefinition.agent.DeclarativeAgent<A>
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<A>
,Serializable
- Direct Known Subclasses:
RetryableDeclarativeAgent
public abstract class DeclarativeAgent<A extends DeclarativeAgent<A>> extends WithScriptDescribable<A> implements ExtensionPoint
Implementations forDeclarativeAgentDescriptor
- pluggable agent backends for Declarative Pipelines.- Author:
- Andrew Bayer
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DeclarativeAgent.CheckoutScriptAllowlist
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
doCheckout
protected boolean
inStage
protected String
subdirectory
-
Constructor Summary
Constructors Constructor Description DeclarativeAgent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
copyFlags(DeclarativeAgent a)
DeclarativeAgentDescriptor
getDescriptor()
WithScriptScript
getScript(org.jenkinsci.plugins.workflow.cps.CpsScript cpsScript)
ONLY TO BE RUN FROM WITHIN A CPS THREAD.String
getSubdirectory()
boolean
hasScmContext(org.jenkinsci.plugins.workflow.cps.CpsScript script)
void
initialize(Map<String,DeclarativeOption> options, boolean explicitAgentInStage)
boolean
isDoCheckout()
boolean
isInStage()
boolean
reuseRootAgent(Map<String,DeclarativeOption> options)
void
setDoCheckout(boolean doCheckout)
void
setInStage(boolean inStage)
void
setSubdirectory(String subdirectory)
-
-
-
Field Detail
-
inStage
protected boolean inStage
-
doCheckout
protected boolean doCheckout
-
subdirectory
protected String subdirectory
-
-
Method Detail
-
getScript
public WithScriptScript getScript(org.jenkinsci.plugins.workflow.cps.CpsScript cpsScript) throws Exception
Description copied from class:WithScriptDescribable
ONLY TO BE RUN FROM WITHIN A CPS THREAD. Parses the script source and loads it. TODO: Decide if we want to cache the resulting objects or just *shrug* and re-parse them every time.- Overrides:
getScript
in classWithScriptDescribable<A extends DeclarativeAgent<A>>
- Returns:
- The script object for this.
- Throws:
Exception
- if the script source cannot be loaded or we're called from outside a CpsThread.
-
setInStage
public void setInStage(boolean inStage)
-
isInStage
public boolean isInStage()
-
initialize
public void initialize(Map<String,DeclarativeOption> options, boolean explicitAgentInStage)
-
reuseRootAgent
public boolean reuseRootAgent(Map<String,DeclarativeOption> options)
-
setDoCheckout
public void setDoCheckout(boolean doCheckout)
-
isDoCheckout
public boolean isDoCheckout()
-
setSubdirectory
public void setSubdirectory(String subdirectory)
-
getSubdirectory
public String getSubdirectory()
-
copyFlags
public void copyFlags(@NonNull DeclarativeAgent a)
-
hasScmContext
public boolean hasScmContext(org.jenkinsci.plugins.workflow.cps.CpsScript script)
-
getDescriptor
public DeclarativeAgentDescriptor getDescriptor()
- Specified by:
getDescriptor
in interfaceDescribable<A extends DeclarativeAgent<A>>
- Overrides:
getDescriptor
in classWithScriptDescribable<A extends DeclarativeAgent<A>>
-
-