DEV Community

Luca Sepe
Luca Sepe

Posted on

An opinionated way to build and maintain complex YAML documents

dirty - Directory to YAML

Create YAML documents from a directory tree.

Build a YAML document from a directory tree containing YAML fragments.

It is useful everywhere complex YAML configuration is employed:

  • CI pipelines
  • Crossplane Compositions
  • Kubernetes manifests, etc.

For instance, Kubernetes resources can be complex, and in turn make the YAML very verbose.

The aim is to make the document easier to reason about and maintain.

How to use

dirty parses a directory tree:

  • a directory is a yaml key
  • a file (a yaml fragment) has content that is rendered at the current indentation level

Check this Crossplane Composition as example: https://github.com/lucasepe/dirty/tree/main/testdata/platform-ref-aws/cluster/eks

Here the repo link: https://github.com/lucasepe/dirty

Regards,
Luca

Top comments (0)