pallet.environment documentation

The environment provide a mechanism for customising pallet and pallet crates according to some externally determined criteria.

An environment can be specified at the global, service, invocation and tag scopes.

To provide a global default, specify an :environment key at the top level of defpallet in ~/.pallet/config.clj.

To provide a service spevific default, specify an :environment key at the service level of defpallet in ~/.pallet/config.clj.

To provide a project specific default, define pallet.config/environment.

To provide a specific environment when invoking lift or converge, pass an environment map using the :environment key.

The merging of values between scopes is key specific, and is determined by merge-key-algorithm.


A protocol for accessing an environment.



Evaluate an environment literal. This is used to replace certain keys with objects constructed from the map of values provided. The keys that are evaluated are: - :user - :phases - :algorithms


[session keys]
[session keys default]

Retrieve the environment value at the path specified by keys. When no default value is specified, then raise a :environment-not-found if no environment value is set.

(get-for {:p {:a {:b 1} {:d 2}}} [:p :a :d])
  => 2


[& maps]

Returns a map that consists of the rest of the maps conj-ed onto the first. If a key occurs in more than one map, the mapping(s) from the latter (left-to-right) will be combined with the mapping in the result by calling (merge-key key val-in-result val-in-latter).


Map from key to merge algorithm. Specifies how environments are merged.


node specific environment keys


[session environment]

Returns an updated session map, containing the keys for the specified environment map.

When session includes a :server value, then the :server value is treated as an environment, and merge with any environment in the environment's :groups key.

The node-specific environment keys are :images and :phases.


[user-map keys]

Shell expand the values matching the specified keys



Returns an environment map