Class WindowsBatchScript
- java.lang.Object
-
- hudson.model.AbstractDescribableImpl<DurableTask>
-
- org.jenkinsci.plugins.durabletask.DurableTask
-
- org.jenkinsci.plugins.durabletask.FileMonitoringTask
-
- org.jenkinsci.plugins.durabletask.WindowsBatchScript
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<DurableTask>
public final class WindowsBatchScript extends FileMonitoringTask
Runs a Windows batch script.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
WindowsBatchScript.DescriptorImpl
-
Nested classes/interfaces inherited from class org.jenkinsci.plugins.durabletask.FileMonitoringTask
FileMonitoringTask.FileMonitoringController
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
Fields Modifier and Type Field Description static boolean
USE_BINARY_WRAPPER
-
Fields inherited from class org.jenkinsci.plugins.durabletask.FileMonitoringTask
BINARY_RESOURCE_PREFIX, COOKIE
-
-
Constructor Summary
Constructors Constructor Description WindowsBatchScript(String script)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
captureOutput()
Requests that standard output of the task be captured rather than streamed.protected FileMonitoringTask.FileMonitoringController
doLaunch(FilePath ws, Launcher launcher, TaskListener listener, EnvVars envVars)
Should start a process which sends output to log file in the workspace and finally writes its exit code to result file.String
getScript()
-
Methods inherited from class org.jenkinsci.plugins.durabletask.FileMonitoringTask
charset, defaultCharset, escape, getAgentInfo, getNodeRoot, launch, launchWithCookie, requestBinary, requestBinary
-
Methods inherited from class org.jenkinsci.plugins.durabletask.DurableTask
getDescriptor
-
-
-
-
Constructor Detail
-
WindowsBatchScript
@DataBoundConstructor public WindowsBatchScript(String script)
-
-
Method Detail
-
getScript
public String getScript()
-
captureOutput
public void captureOutput()
Description copied from class:DurableTask
Requests that standard output of the task be captured rather than streamed. If you useController.watch(hudson.FilePath, org.jenkinsci.plugins.durabletask.Handler, hudson.model.TaskListener)
, standard output will not be sent toHandler.output(java.io.InputStream)
; it will be included inHandler.exited(int, byte[])
instead. Otherwise (using polling mode), standard output will not be sent toController.writeLog(hudson.FilePath, java.io.OutputStream)
; callController.getOutput(hudson.FilePath, hudson.Launcher)
to collect. Standard error should still be streamed to the log. Should be called prior toDurableTask.launch(hudson.EnvVars, hudson.FilePath, hudson.Launcher, hudson.model.TaskListener)
to take effect.- Overrides:
captureOutput
in classDurableTask
-
doLaunch
protected FileMonitoringTask.FileMonitoringController doLaunch(FilePath ws, Launcher launcher, TaskListener listener, EnvVars envVars) throws IOException, InterruptedException
Description copied from class:FileMonitoringTask
Should start a process which sends output to log file in the workspace and finally writes its exit code to result file.- Overrides:
doLaunch
in classFileMonitoringTask
- Parameters:
ws
- the workspace to uselauncher
- a way to launch processeslistener
- build console logenvVars
- recommended environment for the subprocess- Returns:
- a specialized controller
- Throws:
IOException
InterruptedException
-
-