Skip to main content

runShell

Perform a native shell command.

Fields

FieldTypeDescriptionDefault
commandstringOptional. Command to perform in the machine's default shell.
argsarray of stringOptional. Arguments for the command.[]
workingDirectorystringOptional. Working directory for the command..
exitCodesarray of integerOptional. Expected exit codes of the command. If the command's actual exit code isn't in this list, the step fails.[0]
stdiostringOptional. Content expected in the command's stdout or stderr. If the expected content can't be found in the command's stdout or stderr, the step fails. Supports strings and regular expressions. To use a regular expression, the string must start and end with a forward slash, like in /^hello-world.*/.
pathstringOptional. File path to save the command's output, relative to directory.
directorystringOptional. Directory to save the command's output. If the directory doesn't exist, creates the directory. If not specified, the directory is your media directory.
maxVariationnumberOptional. Allowed variation in percentage of text different between the current output and previously saved output. If the difference between the current output and the previous output is greater than maxVariation, the step fails. If output doesn't exist at path, this value is ignored.0
overwritestringOptional. If true, overwrites the existing output at path if it exists.
If aboveVariation, overwrites the existing output at path if the difference between the new output and the existing output is greater than maxVariation.

Accepted values: true, false, aboveVariation
aboveVariation
timeoutintegerOptional. Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.60000

Examples

"docker run hello-world"
{
"command": "echo",
"args": [
"$USER"
]
}
{
"command": "echo",
"args": [
"hello-world"
]
}
{
"command": "docker run hello-world",
"timeout": 20000,
"exitCodes": [
0
],
"stdio": "Hello from Docker!"
}
{
"command": "false",
"exitCodes": [
1
]
}
{
"command": "echo",
"args": [
"setup"
],
"exitCodes": [
0
],
"stdio": "/.*?/"
}
{
"command": "docker run hello-world",
"workingDirectory": ".",
"exitCodes": [
0
],
"stdio": "Hello from Docker!",
"path": "docker-output.txt",
"directory": "output",
"maxVariation": 0.1,
"overwrite": "aboveVariation"
}