sshkit v0.3.0 SSHKit.Context View Source
A context encapsulates the environment for the execution of a task. That is:
- hosts to run the task on, see
SSHKit.context/2 - working directory to start in, see
SSHKit.path/2 - user to run as, see
SSHKit.user/2 - group, see
SSHKit.group/2 - file creation mode mask, see
SSHKit.umask/2 - environment variables, see
SSHKit.env/2
A context can then be used to run commands, upload or download files:
See SSHKit.run/2, SSHKit.upload/3 and SSHKit.download/3.
Link to this section Summary
Functions
Compiles an executable command string for running the given command
in the provided context.
Link to this section Functions
Compiles an executable command string for running the given command
in the provided context.
Examples
iex> %SSHKit.Context{path: "/var/www"} |> SSHKit.Context.build("ls")
"cd /var/www && /usr/bin/env ls"
iex> %SSHKit.Context{user: "me"} |> SSHKit.Context.build("whoami")
"sudo -H -n -u me -- sh -c '/usr/bin/env whoami'"