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
Modifier and TypeClassDescriptionstatic final class
static class
static final class
Represents one task that is believed to still be running.Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Field Summary
Modifier and TypeFieldDescriptionstatic long
How many seconds to wait before interrupting remote calls and before forcing cleanup when the step is stoppedstatic boolean
If set to false, disablesDurableTaskStep.Execution.watching
mode.static long
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetLabel()
boolean
boolean
void
setEncoding
(String encoding) void
void
setReturnStatus
(boolean returnStatus) void
setReturnStdout
(boolean returnStdout) static void
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 org.jenkinsci.plugins.workflow.steps.Step
getDescriptor
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 Details
-
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_WATCHINGIf set to false, disablesDurableTaskStep.Execution.watching
mode. -
REMOTE_TIMEOUT
public static long REMOTE_TIMEOUTHow many seconds to wait before interrupting remote calls and before forcing cleanup when the step is stopped
-
-
Constructor Details
-
DurableTaskStep
public DurableTaskStep()
-
-
Method Details
-
task
protected abstract org.jenkinsci.plugins.durabletask.DurableTask task() -
isReturnStdout
public boolean isReturnStdout() -
setReturnStdout
@DataBoundSetter public void setReturnStdout(boolean returnStdout) -
getEncoding
-
setEncoding
-
isReturnStatus
public boolean isReturnStatus() -
setReturnStatus
@DataBoundSetter public void setReturnStatus(boolean returnStatus) -
setLabel
-
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
-