| Crates.io | confpiler_cli |
| lib.rs | confpiler_cli |
| version | 0.5.0 |
| created_at | 2022-03-06 04:05:38.980919+00 |
| updated_at | 2023-06-14 05:17:57.783608+00 |
| description | A configuration "compiler" and exporter |
| homepage | https://github.com/mattcl/confpiler |
| repository | https://github.com/mattcl/confpiler |
| max_upload_size | |
| id | 544363 |
| size | 72,648 |
This cli tool is intended to "compile" an ordered set of configuration files into a single, flattened representation suitable for exporting to environment variables.
For a complete list of subcommands/option (and more detailed help), see the
relevant --help section.
# given a file, config.yaml
foo:
bar: 10
baz: false
hoof: https://some.url
$ confpiler build config.yaml
FOO__BAR="10"
FOO__BAZ="false"
HOOF="https://some.url"
Given some files like the following:
somedir/
global.yaml
myapp/
default.yaml
development.yaml
production.yaml
staging.yaml
We can compile to a single representation of the "production" configuration with
$ cd somedir
$ confpiler build global.yaml myapp --env production --json
Which would yield a dictionary in JSON form representing merging global.yaml,
myapp/default.yaml and myapp/production.yaml.
Currently this tool requires a "default" file when processing a directory.
Substituting check for build will just verify whether or not the
configuration could be made given the options specified.
$ confpiler check global.yaml myapp --env staging
# or stricter
$ confpiler check global.yaml myapp --env staging --strict
The following formats are currently supported: