pallet.execute documentation

Exectute commands. At the moment the only available transport is ssh.

bash-command

[expr]

Adds an explicit bash invocation to a script command string.

bash-on-origin

[session f]

Execute a bash action on the origin

clojure-on-origin

[session f]

Execute a clojure function on the origin

echo-bash

[session f]

Echo a bash action. Do not execute.

echo-clojure

[session f]

Echo a clojure action (which returns nil)

echo-transfer

[session f]

echo transfer of files

execute-echo

[handler]

Execute cmds for target on the local machine

execute-target-on-localhost

[handler]

Execute cmds for target on the local machine

execute-with-ssh

[handler]

Execute cmds for the session. Also accepts an IP or hostname as address.

local-checked-script

[msg & body]

Run a script on the local machine, setting up stevedore to produce the correct target specific code. The return code is checked.

local-cmds

[commands]

Run local cmds on a target.

local-script

[& body]

Run a script on the local machine, setting up stevedore to produce the correct target specific code

local-script-expand

[expr]

Expand a script expression.

output-poll-period

Specifies the polling period for retrieving ssh command output. Defaults to 1000ms.

remote-exec

[server command user]

Run an ssh exec command on a server.

remote-sudo

[server command user {:keys [pty agent-forwarding], :as options}]

Run a sudo command on a server.

remote-sudo-cmd

[server ssh-session sftp-channel user tmpfile command {:keys [pty agent-forwarding], :or {pty true}, :as options}]

Execute remote command. Copies command to tmpfile on the remote node using the sftp-channel and executes the tmpfile as the specified user.

sh-script

[command]

Run a script on local machine.

ssh-bash-on-target

[session f]

Execute a bash action on the target via ssh.

ssh-from-local

[session f]

Transfer a file from the origin machine to the target via ssh.

ssh-output-buffer-size

Specifies the buffer size used to read the ssh output stream. Defaults to 10K, to match clj-ssh.ssh/piped-stream-buffer-size

ssh-to-local

[session f]

Transfer a file from the origin machine to the target via ssh.

ssh-user-credentials

[handler]

Middleware to user the session :user credentials for SSH authentication.

sudo-cmd-for

[user]

Construct a sudo command prefix for the specified user.

transfer-on-origin

[session f]

Transfer files on origin by copying

verify-sh-return

[msg cmd result]

Verify the return code of a sh execution

with-ssh-tunnel

[session tunnels & body]

Execute the body with an ssh-tunnel available for the ports given in the tunnels map. Automatically closes port forwards on completion.

Tunnels should be a map from local ports (integers) to either 1) An integer remote port. Remote host is assumed to be "localhost". 2) A vector of remote host and remote port. eg, ["yahoo.com" 80].

e.g. (with-ssh-tunnel session {2222 22} ;; do something on local port 2222 session)