Marea.Config.Yaml (marea v0.0.1-rc.1)

Copy Markdown View Source

Wrapper around YamlElixir that supports file includes.

Use include!path.yaml as a value to include the contents of another YAML file. Paths are relative to the including file. Recursive includes are supported; circular includes raise an error.

Summary

Functions

Bootstraps a new marea project in the current directory: creates marea.d/ with configs/ and secrets/ subdirectories and a stub marea.d/marea.yaml.

Ordered list of paths Marea looks for a config in.

Finds and reads the first existing config from marea.yaml, config/marea.yaml, or marea.d/marea.yaml, expanding any include! directives.

Functions

bootstrap!()

@spec bootstrap!() :: :ok | no_return()

Bootstraps a new marea project in the current directory: creates marea.d/ with configs/ and secrets/ subdirectories and a stub marea.d/marea.yaml.

Aborts if a config already exists at any config_candidates/0 path. Invoked by marea setup init-marea.

config_candidates()

@spec config_candidates() :: [String.t()]

Ordered list of paths Marea looks for a config in.

find_config()

@spec find_config() :: {:ok, {String.t(), map()}} | :not_found

Finds and reads the first existing config from marea.yaml, config/marea.yaml, or marea.d/marea.yaml, expanding any include! directives.

Returns {:ok, {path, terms}} when found, or :not_found otherwise. Bootstrapping a missing config is done explicitly via marea setup init (see bootstrap!/0), not here.