https://www.jenkins.io/doc/pipeline/steps/workflow-durable-task-step/#pipeline-nodes-and-processes
bat
: Windows Batch Script
-
script
Executes a Batch script. Multiple lines allowed. When using the
returnStdout
flag, you probably wish to prefix this with@
, lest the command itself be included in the output.-
Type:
String
-
Type:
-
encoding
(optional)Encoding of process output. In the case of
returnStdout
, applies to the return value of this step; otherwise, or always for standard error, controls how text is copied to the build log. If unspecified, uses the system default encoding of the node on which the step is run. If there is any expectation that process output might include non-ASCII characters, it is best to specify the encoding explicitly. For example, if you have specific knowledge that a given process is going to be producing UTF-8 yet will be running on a node with a different system encoding (typically Windows, since every Linux distribution has defaulted to UTF-8 for a long time), you can ensure correct output by specifying:encoding: 'UTF-8'
-
Type:
String
-
Type:
-
label
(optional)Label to be displayed in the pipeline step view and blue ocean details for the step instead of the step type. So the view is more meaningful and domain specific instead of technical.
-
Type:
String
-
Type:
-
returnStatus
(optional)Normally, a script which exits with a nonzero status code will cause the step to fail with an exception. If this option is checked, the return value of the step will instead be the status code. You may then compare it to zero, for example.
-
Type:
boolean
-
Type:
-
returnStdout
(optional)If checked, standard output from the task is returned as the step value as a
String
, rather than being printed to the build log. (Standard error, if any, will still be printed to the log.) You will often want to call.trim()
on the result to strip off a trailing newline.-
Type:
boolean
-
Type:
powershell
: Windows PowerShell Script
-
script
Executes a Windows PowerShell script (version 3 or later). Multiple lines allowed.
-
Type:
String
-
Type:
-
encoding
(optional)Encoding of process output. In the case of
returnStdout
, applies to the return value of this step; otherwise, or always for standard error, controls how text is copied to the build log. If unspecified, uses the system default encoding of the node on which the step is run. If there is any expectation that process output might include non-ASCII characters, it is best to specify the encoding explicitly. For example, if you have specific knowledge that a given process is going to be producing UTF-8 yet will be running on a node with a different system encoding (typically Windows, since every Linux distribution has defaulted to UTF-8 for a long time), you can ensure correct output by specifying:encoding: 'UTF-8'
-
Type:
String
-
Type:
-
label
(optional)Label to be displayed in the pipeline step view and blue ocean details for the step instead of the step type. So the view is more meaningful and domain specific instead of technical.
-
Type:
String
-
Type:
-
returnStatus
(optional)Normally, a script which exits with a nonzero status code will cause the step to fail with an exception. If this option is checked, the return value of the step will instead be the status code. You may then compare it to zero, for example.
-
Type:
boolean
-
Type:
-
returnStdout
(optional)If checked, standard output from the task is returned as the step value as a
String
, rather than being printed to the build log. (Standard error, if any, will still be printed to the log.) You will often want to call.trim()
on the result to strip off a trailing newline.-
Type:
boolean
-
Type:
pwsh
: PowerShell Core Script
-
script
Executes a PowerShell script. Multiple lines allowed. This plugin supports PowerShell Core 6+.
-
Type:
String
-
Type:
-
encoding
(optional)Encoding of process output. In the case of
returnStdout
, applies to the return value of this step; otherwise, or always for standard error, controls how text is copied to the build log. If unspecified, uses the system default encoding of the node on which the step is run. If there is any expectation that process output might include non-ASCII characters, it is best to specify the encoding explicitly. For example, if you have specific knowledge that a given process is going to be producing UTF-8 yet will be running on a node with a different system encoding (typically Windows, since every Linux distribution has defaulted to UTF-8 for a long time), you can ensure correct output by specifying:encoding: 'UTF-8'
-
Type:
String
-
Type:
-
label
(optional)Label to be displayed in the pipeline step view and blue ocean details for the step instead of the step type. So the view is more meaningful and domain specific instead of technical.
-
Type:
String
-
Type:
-
returnStatus
(optional)Normally, a script which exits with a nonzero status code will cause the step to fail with an exception. If this option is checked, the return value of the step will instead be the status code. You may then compare it to zero, for example.
-
Type:
boolean
-
Type:
-
returnStdout
(optional)If checked, standard output from the task is returned as the step value as a
String
, rather than being printed to the build log. (Standard error, if any, will still be printed to the log.) You will often want to call.trim()
on the result to strip off a trailing newline.-
Type:
boolean
-
Type:
sh
: Shell Script
-
script
Runs a Bourne shell script, typically on a Unix node. Multiple lines are accepted.
An interpreter selector may be used, for example:
#!/usr/bin/perl
Otherwise the system default shell will be run, using the
-xe
flags (you can specifyset +e
and/orset +x
to disable those).-
Type:
String
-
Type:
-
encoding
(optional)Encoding of process output. In the case of
returnStdout
, applies to the return value of this step; otherwise, or always for standard error, controls how text is copied to the build log. If unspecified, uses the system default encoding of the node on which the step is run. If there is any expectation that process output might include non-ASCII characters, it is best to specify the encoding explicitly. For example, if you have specific knowledge that a given process is going to be producing UTF-8 yet will be running on a node with a different system encoding (typically Windows, since every Linux distribution has defaulted to UTF-8 for a long time), you can ensure correct output by specifying:encoding: 'UTF-8'
-
Type:
String
-
Type:
-
label
(optional)Label to be displayed in the pipeline step view and blue ocean details for the step instead of the step type. So the view is more meaningful and domain specific instead of technical.
-
Type:
String
-
Type:
-
returnStatus
(optional)Normally, a script which exits with a nonzero status code will cause the step to fail with an exception. If this option is checked, the return value of the step will instead be the status code. You may then compare it to zero, for example.
-
Type:
boolean
-
Type:
-
returnStdout
(optional)If checked, standard output from the task is returned as the step value as a
String
, rather than being printed to the build log. (Standard error, if any, will still be printed to the log.) You will often want to call.trim()
on the result to strip off a trailing newline.-
Type:
boolean
-
Type:
ws
: Allocate workspace
Allocates a workspace. Note that a workspace is automatically allocated for you with the node
step.
-
dir
A workspace is automatically allocated for you with the
node
step, or you can get an alternate workspace with thisws
step, but by default the location is chosen automatically. (Something likeAGENT_ROOT/workspace/JOB_NAME@2
.)You can instead specify a path here and that workspace will be locked instead. (The path may be relative to the build agent root, or absolute.)
If concurrent builds ask for the same workspace, a directory with a suffix such as
@2
may be locked instead. Currently there is no option to wait to lock the exact directory requested; if you need to enforce that behavior, you can either fail (error
) whenpwd
indicates that you got a different directory, or you may enforce serial execution of this part of the build by some other means such asstage name: '…', concurrency: 1
.If you do not care about locking, just use the
dir
step to change current directory.-
Type:
String
-
Type:
网友评论