Class DurableTaskStep
- java.lang.Object
-
- hudson.model.AbstractDescribableImpl<org.jenkinsci.plugins.workflow.steps.Step>
-
- org.jenkinsci.plugins.workflow.steps.Step
-
- org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<org.jenkinsci.plugins.workflow.steps.Step>
,EnvVarsFilterableBuilder
- Direct Known Subclasses:
BatchScriptStep
,PowerShellCoreScriptStep
,PowershellScriptStep
,ShellStep
public abstract class DurableTaskStep extends org.jenkinsci.plugins.workflow.steps.Step implements EnvVarsFilterableBuilder
Runs a durable task, such as a shell script, typically on an agent.“Durable” in this context means that Jenkins makes an attempt to keep the external process running even if either the Jenkins controller or an agent JVM is restarted. Process standard output is directed to a file near the workspace, rather than holding a file handle open. Whenever a Remoting connection between the two can be reëstablished, Jenkins again looks for any output sent since the last time it checked. When the process exits, the status code is also written to a file and ultimately results in the step passing or failing.
Tasks can also be run on the built-in node, which differs only in that there is no possibility of a network failure.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DurableTaskStep.AgentReconnectionListener
static class
DurableTaskStep.DurableTaskStepDescriptor
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
Fields Modifier and Type Field Description static long
REMOTE_TIMEOUT
How many seconds to wait before interrupting remote calls and before forcing cleanup when the step is stoppedstatic boolean
USE_WATCHING
If set to false, disablesDurableTaskStep.Execution.watching
mode.static long
WATCHING_RECURRENCE_PERIOD
-
Constructor Summary
Constructors Constructor Description DurableTaskStep()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description String
getEncoding()
String
getLabel()
boolean
isReturnStatus()
boolean
isReturnStdout()
void
setEncoding(String encoding)
void
setLabel(String label)
void
setReturnStatus(boolean returnStatus)
void
setReturnStdout(boolean returnStdout)
static void
shutDownThreadPool()
org.jenkinsci.plugins.workflow.steps.StepExecution
start(org.jenkinsci.plugins.workflow.steps.StepContext context)
protected abstract org.jenkinsci.plugins.durabletask.DurableTask
task()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jenkins.tasks.filters.EnvVarsFilterableBuilder
buildEnvVarsFilterRules
-
-
-
-
Field Detail
-
WATCHING_RECURRENCE_PERIOD
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static long WATCHING_RECURRENCE_PERIOD
-
USE_WATCHING
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static boolean USE_WATCHING
If set to false, disablesDurableTaskStep.Execution.watching
mode.
-
REMOTE_TIMEOUT
public static long REMOTE_TIMEOUT
How many seconds to wait before interrupting remote calls and before forcing cleanup when the step is stopped
-
-
Method Detail
-
task
protected abstract org.jenkinsci.plugins.durabletask.DurableTask task()
-
isReturnStdout
public boolean isReturnStdout()
-
setReturnStdout
@DataBoundSetter public void setReturnStdout(boolean returnStdout)
-
getEncoding
public String getEncoding()
-
setEncoding
@DataBoundSetter public void setEncoding(String encoding)
-
isReturnStatus
public boolean isReturnStatus()
-
setReturnStatus
@DataBoundSetter public void setReturnStatus(boolean returnStatus)
-
setLabel
@DataBoundSetter public void setLabel(String label)
-
getLabel
public String getLabel()
-
start
public org.jenkinsci.plugins.workflow.steps.StepExecution start(org.jenkinsci.plugins.workflow.steps.StepContext context) throws Exception
- Specified by:
start
in classorg.jenkinsci.plugins.workflow.steps.Step
- Throws:
Exception
-
shutDownThreadPool
@Terminator public static void shutDownThreadPool()
-
-