Provides SSH control over a remote node. There's a lot of dynamically bound state in this namespace because we want to make it as simple as possible for scripts to open connections to various nodes.
Provides SSH control over a remote node. There's a lot of dynamically bound state in this namespace because we want to make it as simple as possible for scripts to open connections to various nodes.
(cd dir & body)
Evaluates forms in the given directory.
Evaluates forms in the given directory.
(check-name host)
Ensures a given hostname is string. Warns user if legacy behavior passes in a keyword host. TODO This can be removed when tests no tests generate keyword hosts. CLI already refuses keyword hostnames.
Ensures a given hostname is string. Warns user if legacy behavior passes in a keyword host. TODO This can be removed when tests no tests generate keyword hosts. CLI already refuses keyword hostnames.
(clj-ssh-session host)
Opens a raw session to the given host.
Opens a raw session to the given host.
(debug-data)
Construct a map of SSH data for debugging purposes.
Construct a map of SSH data for debugging purposes.
(download & args)
Copies remote paths to local node. Takes arguments for clj-ssh/scp-from. Retres failures.
Copies remote paths to local node. Takes arguments for clj-ssh/scp-from. Retres failures.
(escape s)
Escapes a thing for the shell.
Nils are empty strings.
Literal wrappers are passed through directly.
The special keywords :>, :>>, and :< map to their corresponding shell I/O redirection operators.
Named things like keywords and symbols use their name, escaped. Strings are escaped like normal.
Sequential collections and sets have each element escaped and space-separated.
Escapes a thing for the shell. Nils are empty strings. Literal wrappers are passed through directly. The special keywords :>, :>>, and :< map to their corresponding shell I/O redirection operators. Named things like keywords and symbols use their name, escaped. Strings are escaped like normal. Sequential collections and sets have each element escaped and space-separated.
(exec & commands)
Takes a shell command and arguments, runs the command, and returns stdout, throwing if an error occurs. Escapes all arguments.
Takes a shell command and arguments, runs the command, and returns stdout, throwing if an error occurs. Escapes all arguments.
(exec* & commands)
Like exec, but does not escape.
Like exec, but does not escape.
(expand-path path)
Expands path relative to the current directory.
Expands path relative to the current directory.
(file->path x)
Takes an object, if it's an instance of java.io.File, gets the path, otherwise returns the object
Takes an object, if it's an instance of java.io.File, gets the path, otherwise returns the object
(just-stdout result)
Returns the stdout from an ssh result, trimming any newlines at the end.
Returns the stdout from an ssh result, trimming any newlines at the end.
(lit s)
A literal string to be passed, unescaped, to the shell.
A literal string to be passed, unescaped, to the shell.
(on host & body)
Opens a session to the given host and evaluates body there; and closes session when body completes.
Opens a session to the given host and evaluates body there; and closes session when body completes.
(on-many hosts & body)
Takes a list of hosts, executes body on each host in parallel, and returns a map of hosts to return values.
Takes a list of hosts, executes body on each host in parallel, and returns a map of hosts to return values.
(on-nodes test f)
(on-nodes test nodes f)
Given a test, evaluates (f test node) in parallel on each node, with that
node's SSH connection bound. If nodes
is provided, evaluates only on those
nodes in particular.
Given a test, evaluates (f test node) in parallel on each node, with that node's SSH connection bound. If `nodes` is provided, evaluates only on those nodes in particular.
(scp* current-path node-path)
Evaluates an SCP from the current host to the node.
Evaluates an SCP from the current host to the node.
(session host)
Wraps clj-ssh-session in a wrapper for reconnection.
Wraps clj-ssh-session in a wrapper for reconnection.
(ssh* action)
Evaluates an SSH action against the current host. Retries packet corrupt errors.
Evaluates an SSH action against the current host. Retries packet corrupt errors.
(sudo user & body)
Evaluates forms with a particular user.
Evaluates forms with a particular user.
(throw-on-nonzero-exit {:keys [exit action] :as result})
Throws when an SSH result has nonzero exit status.
Throws when an SSH result has nonzero exit status.
(trace & body)
Evaluates forms with command tracing enabled.
Evaluates forms with command tracing enabled.
(upload & [local-paths remote-path & remaining])
Copies local path(s) to remote node and returns the remote path. Takes arguments for clj-ssh/scp-to.
Copies local path(s) to remote node and returns the remote path. Takes arguments for clj-ssh/scp-to.
(with-session host session & body)
Binds a host and session and evaluates body. Does not open or close session; this is just for the namespace dynamics state.
Binds a host and session and evaluates body. Does not open or close session; this is just for the namespace dynamics state.
(with-ssh ssh & body)
Takes a map of SSH configuration and evaluates body in that scope. Catches JSchExceptions and re-throws with all available debugging context. Options:
:dummy? :username :password :private-key-path :strict-host-key-checking
Takes a map of SSH configuration and evaluates body in that scope. Catches JSchExceptions and re-throws with all available debugging context. Options: :dummy? :username :password :private-key-path :strict-host-key-checking
(with-test-nodes test & body)
Given a test, evaluates body in parallel on each node, with that node's SSH connection bound.
Given a test, evaluates body in parallel on each node, with that node's SSH connection bound.
(wrap-cd cmd)
Wraps command by changing to the current bound directory first.
Wraps command by changing to the current bound directory first.
(wrap-sudo cmd)
Wraps command in a sudo subshell.
Wraps command in a sudo subshell.
(wrap-trace arg)
Logs argument to console when tracing is enabled.
Logs argument to console when tracing is enabled.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close