From 6535634c4c15d707da608fc2168d0cc0c10d3358 Mon Sep 17 00:00:00 2001 From: Aleksandar Stojanov Date: Mon, 24 Jun 2024 18:05:42 +0200 Subject: [PATCH] add documentation and bump version to 1.5.0 Signed-off-by: Aleksandar Stojanov --- .pre-commit-config.yaml | 2 +- README.md | 38 +++++++++++++++++++++++++++++++++----- plugin.yaml | 2 +- schema.yaml | 1 + 4 files changed, 36 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bcf14c6..19fce8f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/losisin/helm-values-schema-json - rev: v1.4.1 + rev: v1.5.0 hooks: - id: helm-schema args: diff --git a/README.md b/README.md index 9319bdc..11646b7 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ First [install pre-commit](https://pre-commit.com/#install) and then create or u ```yaml repos: - repo: https://github.com/losisin/helm-values-schema-json - rev: v1.4.1 + rev: v1.5.0 hooks: - id: helm-schema args: ["-input", "values.yaml"] @@ -108,7 +108,35 @@ Usage: helm schema [options...] JSON schema title ``` -### Basic +### Configuration file + +This plugin will look for it's configuration file called `schema.yaml` in the current working directory. All options available from CLI can be set in this file. Example: + +```yaml +# Required +input: + - schema.yaml + +draft: 2020 +indent: 4 +output: values.schema.json + +schemaRoot: + id: https://example.com/schema + title: Helm Values Schema + description: Schema for Helm values + additionalProperties: true +``` + +Then, just run the plugin without any arguments: + +```bash +$ helm schema +``` + +### CLI + +#### Basic In most cases you will want to run the plugin with default options: @@ -118,9 +146,9 @@ $ helm schema -input values.yaml This will read `values.yaml`, set draft version to `2020-12` and save outpout to `values.schema.json`. -### Extended +#### Extended -#### Multiple values files +##### Multiple values files Merge multiple values files, set json-schema draft version explicitly and save output to `my.schema.json`: @@ -217,7 +245,7 @@ Output will be something like this: } ``` -#### Root JSON object properties +##### Root JSON object properties Adding ID, title and description to the schema: diff --git a/plugin.yaml b/plugin.yaml index e9f8a0e..cbcdae4 100644 --- a/plugin.yaml +++ b/plugin.yaml @@ -1,5 +1,5 @@ name: "schema" -version: "1.4.1" +version: "1.5.0" usage: "generate values.schema.json from values yaml" description: "Helm plugin for generating values.schema.json from multiple values files." ignoreFlags: false diff --git a/schema.yaml b/schema.yaml index 9d715a9..d17036d 100644 --- a/schema.yaml +++ b/schema.yaml @@ -1,3 +1,4 @@ +# Required input: - schema.yaml