DEV Community

Luca Sepe
Luca Sepe

Posted on

1

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

Heroku

This site is built on Heroku

Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!

Get Started

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay