Script
Script is a set of tasks for running scripts on the host. These can be dangerous and should be used sparingly.
script/shell
Available on UNIX like platforms including BSD, macOS, and Linux, but will raise an error if attempted to be used on Windows.
Either a filename or commands must be specified, but specifying both is an error as Convey will not know which one you want to prioritize. When commands are specified, a temporary file will be created containing the given commands.
Attributes
Name | Required | Default | Description |
---|---|---|---|
commands | A list of commands to run as the script. | ||
environment | A list of environment variables to set. This should be specified in a NAME or NAME=VALUE format. |
||
filename | The name of a script file to run. The file must exist in the directory containing the current convey configuration file or a subdirectory. | ||
shell | The shell to use. If not specified the users default shell will be used. |
Examples
Run an existing script
run-script:
type: script/shell
filename: script.sh
Run an adhoc script with a single command. The commands
parameter will work
with a single string or a list of strings
uptime:
type: script/shell
commands: uptime
uname:
type: script/shell
commands:
- uname -a
Run an adhoc script in Z Shell
zshell:
type: script/shell
shell: /bin/zsh
commands:
- uname
- uptime