Configuration rulesΒΆ
The configuration file uses the yaml format, with a few extra rules:
environment variables (such as
$PATH
) in values are expanded automatically. Note that unresolved variables of the shape$FOO
are ignored, whereas variables of the shape${FOO}
will result in an error if they are not resolved.values may reference other values in the configuration file:
BUILD:
nr_of_threads: 2
FOO:
bar: ${/BUILD/nr_of_threads} # value will be the number 2
${/BUILD/nr_of_threads}_foo: baz # key will be the string "2_foo"
the following magic values are automatically added:
${/ROOT/project_name}
,${/ROOT/project_dir}
,${/ROOT/res_dir}
. Finally the dodo_system_commands directory is automatically added to${/ROOT/command_path}
.${/ROOT/LAYERS}
lists additional yaml files that are layered on top of the root configuration file. If a key exists both in the root configuration and in the layer, then values replace values, lists are concatenated, and dictionaries are merged. Layers are found relative to the resources directory that holds all configuration files. However, layers may also be prefixed with an absolute path. Moreover, wildcards are allowed. To list all active layers, usedodo which --layers
.
ROOT:
layers:
# contents of this file are layered on top of this configuration
- buildtype.debug.yaml
# layer with an absolute path
- ~/.dodo_commands/default_layer.yaml
# example of using wildcards
- ~/.dodo_commands/default_layers/*.yaml
Layers can be switched on and off with the dodo layer
command (except for the ones with absolute paths). In the above example, to replace the layer buildtype.debug.yaml
with buildtype.release.yaml
call:
dodo layer buildtype release
All files in
{/ROOT/dotenv_files}
are loaded withpython-dotenv
and used in the expansion of environment variables in the Dodo configuration. Note that these values are not added to the environment during the execution of a command script.