• Stars
    star
    206
  • Rank 190,569 (Top 4 %)
  • Language
    JavaScript
  • License
    Apache License 2.0
  • Created over 3 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Auto generate READMEs for Helm Charts

Readme Generator For Helm

  • Autogenerate Helm Charts READMEs' tables based on values YAML file metadata.
  • Autogenerate an OpenAPI compliant JSON schema defining the values.yaml structure of the Helm Chart. The file generated will be a JSON file formatted according to the OpenAPIv3 SchemaObject definition.

How it works

The tool expects some metadata for the descriptions in the provided values.yaml file. It will parse and check the metadata against the real values. If the metadata is consistent with the real values, it will generate and insert the values table into the provided README.md file. If the metadata is not correct, it will print the full list of errors. It checks whether there is metadata for non-existing values or there is missing metadata for an existing value.

The table that will be inserted into the readme.md will have the following structure:

## Parameters

### Section 1 title

| Name      | Description             | Default        |
|:----------|:------------------------|:---------------|
| `value_1` | Description for value 1 | `defaultValue` |
| `value_2` | Description for value 2 | `defaultValue` |
| `value_3` | Description for value 3 | `defaultValue` |

### Section 2 title

| Name      | Description             | Default        |
|:----------|:------------------------|:---------------|
| `value_1` | Description for value 1 | `defaultValue` |
| `value_2` | Description for value 2 | `defaultValue` |
| `value_3` | Description for value 3 | `defaultValue` |

...

The number of # characters needed for the section titles is dynamically calculated, and the title of the Parameters section can be configured via the configuration file. The README.md file with a # Parameters section must be created before running the tool.

Requirements

The project has been developed and tested with node version 16.x.

Install

Execute the following commands to install the tool:

git clone https://github.com/bitnami-labs/readme-generator-for-helm
npm install ./readme-generator-for-helm

Depending on how you installed NodeJS in your system, you may need to modify your PATH environment variable to be able to execute the tool.

Single Binary

Execute the following commands to create a single executable binary for the tool:

git clone https://github.com/bitnami-labs/readme-generator-for-helm
cd ./readme-generator-for-helm
npm install -g pkg
pkg . -o readme-generator-for-helm

Test

We use Jest to implement the tests. In order to test your changes, execute the following command:

npm run-script test

Lint

After modifying the code execute the following command to pass the linter:

npm run-script lint

Basic usage

Usage: readme-generator [options]

Options:
  -v, --values <path>  Path to the values.yaml file
  -r, --readme <path>  Path to the README.md file
  -c, --config <path>  Path to the config file
  -s, --schema <path>  Path for the OpenAPI Schema output file
  --version            Show Readme Generator version
  -h, --help           display help for command

values.yaml Metadata

For the tool to work, you need to add some metadata to your values.yaml file.

By default we use a format similar to Javadoc, using @xxx for tags followed by the tag structure.

The following are the tags supported at this very moment:

  • For a parameter: ## @param fullKeyPath [modifier?] Description.
  • For a section: ## @section Section Title".
  • To skip an object and all its children: ## @skip fullKeyPath.
  • To add a description for an intermediate object (i.e. not final in the YAML tree): ## @extra fullkeyPath Description.

All the tags as well as the two initial # characters for the comments style can be configured in the configuration file.

IMPORTANT: tags' order or position in the file is NOT important except for the @section tag. The @section that will include in the section all the parameters after it until a new section is found or the file ends.

The modifier is optional and it will change how the parameter is processed. Several modifiers can be applied by separating them using commas (,). When affecting the value, the last one takes precedence.

Currently supported modifiers:

  • [array] Indicates that the value of the parameter must be set to [].
  • [object] Indicates that the value of the parameter must be set to {}.
  • [string] Indicates that the value of the parameter must be set to "".
  • [nullable] Indicates that the parameter value can be set to null.

The modifiers are also customizable via the configuration file.

Configuration file

The configuration file has the following structure:

{
  "comments": {
    "format": "##"                               <-- Which is the comments format in the values YAML
  },
  "tags": {
    "param": "@param",                           <-- Tag that indicates a parameter
    "section": "@section",                       <-- Tag that indicates a section
    "descriptionStart": "@descriptionStart",     <-- Tag that indicates the beginning of a section description
    "descriptionEnd": "@descriptionEnd",         <-- Tag that indicates the end of a section description
    "skip": "@skip",                             <-- Tag that indicates the object must be skipped
    "extra": "@extra"                            <-- Tag to add a description for an intermediate object
  },
  "modifiers": {
    "array": "array",                            <-- Modifier that indicates an array type
    "object": "object"                           <-- Modifier that indicates an object type
    "string": "string"                           <-- Modifier that indicates a string type
    "nullable": "nullable"                       <-- Modifier that indicates a parameter that can be set to null
  },
  "regexp": {
    "paramsSectionTitle": "Parameters"           <-- Title of the parameters section to replace in the README.md
  }
}

Versions

2.4.0

Add descriptionStart and descriptionEnd config options (default tags: @descriptionStart and @descriptionEnd) to allow text block upfront each section table in README.md. When changing the tag values for these, ensure to not being conflicted with section config option.

If you are using a customized configuration file, please add the new default tags to prevent any incorrect behavior.

2.0.0

The -m (--metadata) option has been renamed to -s (--schema) in order to properly identify what it generates.

License

Copyright © 2023 VMware, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

More Repositories

1

charts

Bitnami Helm Charts
Smarty
8,689
star
2

containers

Bitnami container images
Shell
3,113
star
3

minideb

A small image based on Debian designed for use in containers
Shell
2,010
star
4

vms

Bitnami VMs
206
star
5

kube-libsonnet

Bitnami's jsonnet library for building Kubernetes manifests
Jsonnet
173
star
6

charts-syncer

Tool for synchronizing Helm Chart repositories.
Go
165
star
7

bitnami-docker-redis-cluster

Bitnami Docker Image for Redis Cluster
Shell
131
star
8

bitnami-docker-openldap

Bitnami Docker Image for OpenLDAP
Shell
84
star
9

gonit

Drop-in replacement for monit written in Go, with Apache 2.0 license
Go
78
star
10

bitnami-docker-keycloak

Bitnami Docker Image for Keycloak
Shell
65
star
11

bitnami-docker-pgbouncer

Bitnami Docker Image for PgBouncer
Shell
44
star
12

wait-for-port

CLI tool for waiting until a TCP port reaches the desired state
Go
35
star
13

render-template

CLI tool for rendering templates with custom data
Go
27
star
14

azure-marketplace-charts

Helm Charts ready to launch on Azure Kubernetes Serice (AKS)
Mustache
27
star
15

ini-file

CLI tool for modifying .ini files
Go
23
star
16

charts-docs

Helm charts docs
HTML
20
star
17

healthcheck-tools

Set of Go tools to check different elements of your stack (SSL, SMTP, Permissions...)
Go
16
star
18

vulndb

The Bitnami Vulnerability Database
Shell
16
star
19

bitnami-docker-thanos

Bitnami Docker Image for Thanos
Dockerfile
14
star
20

bitnami-docker-golang

Bitnami Docker Image for Golang
Dockerfile
11
star
21

bitnami-docker-nginx-ldap-auth-daemon

Shell
11
star
22

bitnami-docker-ejbca

Bitnami Docker Image for EJBCA
Shell
10
star
23

bitnami-docker-openresty

Bitnami Docker Image for OpenResty
Shell
9
star
24

bitnami-docker-rclone

Bitnami Docker Image for rClone
Dockerfile
9
star
25

bitnami-docker-kubernetes-event-exporter

Bitnami Docker Image for Kubernetes Event Exporter
Dockerfile
8
star
26

bitnami-docker-aws-cli

Bitnami Docker Image for AWS CLI
Dockerfile
6
star
27

bitnami-docker-envoy

Bitnami Docker Image for Envoy
Dockerfile
5
star
28

bncert

Bitnami HTTPS Configuration Tool
Shell
5
star
29

bitnami-docker-keycloak-config-cli

Bitnami Docker Image for keycloak-config-cli
Dockerfile
5
star
30

bndiagnostic

Bitnami Diagnostic Tool
Shell
5
star
31

bitnami-docker-dotnet-sdk

Bitnami Docker Image for .NET SDK
Shell
4
star
32

bitnami-docker-spring-cloud-dataflow

Bitnami Docker Image for Spring Cloud Data Flow
Shell
4
star
33

bitnami-docker-grafana-image-renderer

Bitnami Docker Image for Grafana Image Renderer
Dockerfile
3
star
34

bitnami-docker-grafana-operator

Bitnami Docker Image for Grafana Operator
Dockerfile
3
star
35

bitnami-docker-jupyterhub

Bitnami Docker Image for JupyterHub
Dockerfile
3
star
36

bitnami-docker-argo-cd

Bitnami Docker Image for Argo CD
Shell
3
star
37

bitnami-docker-cert-manager-webhook

Bitnami Docker Image for Cert Manager Webhook
Dockerfile
3
star
38

bitnami-docker-azure-cli

Bitnami Docker Image for Azure CLI
Dockerfile
3
star
39

bitnami-docker-jupyter-base-notebook

Bitnami Docker Image for Jupyter Base Notebook
Dockerfile
3
star
40

bitnami-docker-wal-g

Dockerfile
3
star
41

bitnami-docker-haproxy-intel

Dockerfile
2
star
42

bitnami-docker-promtail

Dockerfile
2
star
43

bitnami-docker-trivy

Bitnami Docker Image for Trivy
Dockerfile
2
star
44

bitnami-docker-google-cloud-sdk

Bitnami Docker Image for Google Cloud SDK
Dockerfile
2
star
45

bitnami-docker-gitlab-runner

Bitnami Docker Image for Gitlab Runner
Shell
2
star
46

bitnami-docker-dotnet

Bitnami Docker Image for .NET
Shell
2
star
47

bitnami-docker-configurable-http-proxy

Bitnami Docker Image for Configurable HTTP Proxy
Dockerfile
2
star
48

bitnami-docker-haproxy

Bitnami Docker Image for HAProxy
Dockerfile
2
star
49

bitnami-docker-kiam

Bitnami Docker Image for Kiam
Dockerfile
2
star
50

bitnami-docker-pytorch-intel

Shell
2
star
51

bitnami-docker-grafana-loki

Dockerfile
2
star
52

bitnami-docker-tensorflow-intel

Bitnami Docker Image for TensorFlow for Intel
Shell
2
star
53

bitnami-docker-harbor-adapter-trivy

Bitnami Docker Image for Harbor Adapter Trivy
Shell
2
star
54

bitnami-docker-phppgadmin

Bitnami Docker Image for phpPgAdmin
Shell
2
star
55

bitnami-docker-rabbitmq-cluster-operator

Bitnami Docker Image for RabbitMQ Cluster Operator
Dockerfile
1
star
56

bitnami-docker-wordpress-intel

Bitnami Docker Image for WordPress for Intel
Shell
1
star
57

bitnami-docker-rmq-default-credential-updater

Bitnami Docker Image for RabbitMQ Default User Credential Updater
Dockerfile
1
star
58

bitnami-docker-python-snapshot

Bitnami Docker Image for Python using snapshots for the system packages repositories
Dockerfile
1
star
59

bitnami-docker-contour

Bitnami Docker Image for Contour
Dockerfile
1
star
60

bitnami-docker-dataplatform-exporter

Bitnami Docker Image for Data Platform BP 1
Dockerfile
1
star
61

bitnami-docker-kong-ingress-controller

Bitnami Docker Image for Kong Ingress Controller
Dockerfile
1
star
62

bitnami-docker-gitlab-runner-helper

Bitnami Docker Image for Gitlab Runner Helper
Shell
1
star
63

bitnami-docker-aspnet-core

Bitnami Docker Image for ASP.NET
Shell
1
star
64

bitnami-docker-sealed-secrets

Dockerfile
1
star
65

bitnami-docker-node-snapshot

Bitnami Docker Image for Node.js using snapshots for the system packages repositories
Dockerfile
1
star
66

bitnami-docker-gradle

Bitnami Docker Image for Gradle
Dockerfile
1
star
67

bitnami-docker-cosign

Bitnami Docker Image for Cosign
Dockerfile
1
star
68

bitnami-docker-argo-workflow-exec

Bitnami Docker Image for Argo Workflow Executor
Shell
1
star
69

bitnami-docker-cainjector

Bitnami Docker Image for CA Injector
Dockerfile
1
star
70

bitnami-docker-inc-intel

Shell
1
star
71

bitnami-docker-grafana-tempo

Bitnami Docker Image for Grafana Tempo
Dockerfile
1
star
72

bitnami-docker-kubeapps-kubeops

Bitnami Docker Image for Kubeapps Kubeops
Dockerfile
1
star
73

bitnami-docker-percona-xtrabackup

Bitnami Docker Image for Percona XtraBackup
Dockerfile
1
star
74

chart-categories-action

A GitHub action to check Helm Charts categories
Shell
1
star
75

bitnami-docker-rmq-messaging-topology-operator

Bitnami Docker Image for RabbitMQ Messaging Topology Operator
Dockerfile
1
star