3.2.0 • Published 2 years ago

@runnerty/executor-shell v3.2.0

Weekly downloads
16
License
MIT
Repository
github
Last release
2 years ago

NPM version Downloads Dependency Status

Shell executor for Runnerty

Installation:

Through NPM

npm i @runnerty/executor-shell

You can also add modules to your project with runnerty

npx runnerty add @runnerty/executor-shell

This command installs the module in your project, adds example configuration in your config.json and creates an example plan of use.

If you have installed runnerty globally you can include the module with this command:

runnerty add @runnerty/executor-shell

Configuration sample:

Add in config.json:

Local

{
  "id": "shell_default",
  "type": "@runnerty-executor-shell"
}

Remote (SSH)

{
  "id": "shell_ssh",
  "type": "@runnerty-executor-shell",
  "host": "remote.server.com",
  "username": "runnerty",
  "privateKey": "./ssh/privateKeyFile.pem"
}
SSH configuratión

Executor shell SSH connection relies on mscdex/ssh2:https://github.com/mscdex/ssh2 and these are the exposed options:

OptionTypeDescription
hoststringHostname or IP address of the server.
portnumberPort number of the server.
forceIPv4booleanOnly connect via resolved IPv4 address for host.
forceIPv6booleanOnly connect via resolved IPv6 address for host.
hostHash"md5" or "sha1"The host's key is hashed using this method and passed to hostVerifier.
usernamestringUsername for authentication.
passwordstringPassword for password-based user authentication.
agentstringPath to ssh-agent's UNIX socket for ssh-agent-based user authentication (or 'pageant' when using Pagent on Windows).
privateKeystringPath to the file that contains a private key for either key-based or hostbased user authentication (OpenSSH format).
passphrasestringFor an encrypted private key, this is the passphrase used to decrypt it.
localHostnamestringAlong with localUsername and privateKey, set this to a non-empty string for hostbased user authentication.
localUsernamestringAlong with localHostname and privateKey, set this to a non-empty string for hostbased user authentication.
tryKeyboardbooleanTry keyboard-interactive user authentication if primary user authentication method fails.
keepaliveIntervalnumberHow often (in milliseconds) to send SSH-level keepalive packets to the server. Set to 0 to disable.
keepaliveCountMaxnumberHow many consecutive, unanswered SSH-level keepalive packets that can be sent to the server before disconnection.
readyTimeoutnumber* How long (in milliseconds) to wait for the SSH handshake to complete.
strictVendorbooleanPerforms a strict server vendor check before sending vendor-specific requests.
agentForwardbooleanSet to true to use OpenSSH agent forwarding (auth-agent@openssh.com) for the life of the connection.

Plan sample:

Add in plan.json:

{
  "id": "shell_default",
  "command": "tar cvfz /var/backups/stf.tar /var/stranger_things/"
}
{
  "id": "shell_default",
  "command": "python",
  "args": ["myscript.py", "hello"]
}
{
  "id": "shell_default",
  "command": "echo",
  "args": ["hello world"]
}

Using the outputJSON param, if you have a process which returns a JSON object, the executor will generate automatically a value for each value of the object:

{
  "id": "shell_default",
  "command": "node my-returning-object-process.js"
}

This the output of my-returning-object-process.js:

{
  "name": "my output name",
  "lastName": "my output lastName"
}

Output values with the object's values. It is possible to access the values by GETVALUE function:

@GV(PROCESS_EXEC_JSON_NAME) --> "my output name"
@GV(PROCESS_EXEC_JSON_LASTNAME) --> "my output lastName"
3.1.3

2 years ago

3.2.0

2 years ago

3.1.4

2 years ago

3.1.2

3 years ago

3.1.1

3 years ago

3.1.0

3 years ago

3.1.0-rc

3 years ago

3.0.3

3 years ago

3.0.2

3 years ago

3.0.1

3 years ago

3.0.0

3 years ago

3.0.0-alpha.2

3 years ago

3.0.0-alpha.1

3 years ago

3.0.0-alpha.0

3 years ago

2.0.0

4 years ago

2.0.0-rc

4 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago