confpiler_cli

Crates.ioconfpiler_cli
lib.rsconfpiler_cli
version0.5.0
sourcesrc
created_at2022-03-06 04:05:38.980919
updated_at2023-06-14 05:17:57.783608
descriptionA configuration "compiler" and exporter
homepagehttps://github.com/mattcl/confpiler
repositoryhttps://github.com/mattcl/confpiler
max_upload_size
id544363
size72,648
Matt Chun-Lum (mattcl)

documentation

README

Confpiler (cli)

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.

A simple example:

# 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"

A more complicated example

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.

Checking

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

Supported formats

The following formats are currently supported:

  • JOSN
  • TOML
  • YAML
  • INI
Commit count: 68

cargo fmt