Skip to content

Commit

Permalink
feat: Add a make rule to generate helm docs
Browse files Browse the repository at this point in the history
It's going to be easier for contributors, if they don't have to figure
out the way to update README.md. So, I guess, it makes sense to have a
Makefile with a corresponding rule.
  • Loading branch information
allanger committed Nov 19, 2023
1 parent 098edd5 commit e845ecc
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions helm/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bin
8 changes: 8 additions & 0 deletions helm/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
LOCALBIN ?= $(shell pwd)/bin
$(LOCALBIN):
mkdir -p $(LOCALBIN)

.PHONY: gen_docs
gen_docs: ## Generate helm documentation
test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install github.com/norwoodj/helm-docs/cmd/helm-docs@latest
./bin/helm-docs --template-files=./README.md.gotmpl --sort-values-order file
4 changes: 4 additions & 0 deletions helm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,7 @@ helm install sql_exporter/sql-exporter
To configure `target`, `jobs`, `collector_files` please refer to the [documentation](https://github.com/burningalchemist/sql_exporter/blob/master/documentation/sql_exporter.yml) in the source repository. These values are not set by default.

It's also possible to define collectors (i.e. metrics and queries) in separate files, and specify the filenames in the `collector_files` list. For that we can use `CollectorFiles` field (check `values.yaml` for the available example).

## Dev Notes

After updating default `Values`, please execute `make gen_docs` to update the `README.md` file
4 changes: 4 additions & 0 deletions helm/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,7 @@ helm install sql_exporter/sql-exporter
To configure `target`, `jobs`, `collector_files` please refer to the [documentation](https://github.com/burningalchemist/sql_exporter/blob/master/documentation/sql_exporter.yml) in the source repository. These values are not set by default.

It's also possible to define collectors (i.e. metrics and queries) in separate files, and specify the filenames in the `collector_files` list. For that we can use `CollectorFiles` field (check `values.yaml` for the available example).

## Dev Notes

After changing default `Values`, please execute `make gen_docs` to update the `README.md` file. Readme file is generated by the `helm-docs` tool, so make sure not to edit it manually.

0 comments on commit e845ecc

Please sign in to comment.