pallet.script-builder documentation

Build scripts with prologues, epilogues, etc, and command lines for running them in different environments

build-code

fn

[session {:keys [default-script-prefix script-context script-dir script-env script-env-fwd script-prefix sudo-user], :as action} & args]

Builds a code map, describing the command to execute a script.

build-script

fn

[{:keys [language version interpreter interpreter-args], :or {language :bash}, :as options} script {:keys [script-dir script-trace script-hash], :or {script-hash true}, :as action}]

Builds a script. The script is wrapped in a shell script to set up the working directory (and possibly environment variables in the future).

interpreter

var

The interprester used to run a script.

normalise-sudo-options

fn

[user action]

Ensure that a :sudo-user specified in the action trumps a :no-sudo specified in the admin user.

prefix

var

The executable used to prefix the interpreter (eg. sudo, chroot, etc).

sudo-cmd-for

fn

[{:keys [no-sudo password sudo-user sudo-password username], :as user}]

Construct a sudo command prefix for the specified user.