basecamp / kamal

Deploy web apps anywhere.
https://kamal-deploy.org
MIT License
9.38k stars 357 forks source link

Configuration validation #828

Closed djmb closed 2 weeks ago

djmb commented 1 month ago

Validate the Kamal configuration giving useful warning on errors. Each section of the configuration has its own config class and a YAML file containing documented example configuration.

You can run kamal docs to see the example configuration, and kamal docs <section> to see the example configuration for a specific section.

The validation matches the configuration to the example configuration checking that there are no unknown keys and that the values are of matching types.

Where there is more complex validation - e.g for envs and servers, we have custom validators that implement those rules.

Additonally the configuration examples are used to generate the configuration documentation in the kamal-site repo.

You generate them by running:

bundle exec bin/docs <kamal-site-checkout>