Command

Command tasks or cmd in short, is used to execute a command.

Command task definition

Similar to cp task, cmd task can run adhoc commands in variety of resources. Following are the attributes of the cmd task.

  1. value: This is value of the command that will be executed.

  2. target: It's an optional value, which expects the alias of one of the supported resources. The supported resources are only remote hosts, i.e. server.

Format

resources.yml
- cmd:
value: <command to be executed>
target: Optional - <alias of resource>

Exec Command in Remotely

demo.flow.yml
project: Demo
resources: /path/to/resources.yml
stages:
- cmd_demo:
- cmd:
value: echo "Hello world"
target: remote

The corresponding resource definition for the remote server is as follows.

resources.yml
resources:
- server:
alias: remote
host: xx.xx.xx.xxx
username: giga
keyFile: /path/to/keyFile.pem

Run the launch tasks

If the launch configuration demo.launch.yml is stored in the current working directory, then you can run the launch command as below.

$ teraflow demo

Else, you need to specify the path of the launch configuration.

$ teraflow -c /path/to/demo.launch.yml

‚Äč