Skip to content

Commit 885c365

Browse files
authored
feat: Add a make rule to generate helm docs (#398)
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.
1 parent 098edd5 commit 885c365

File tree

5 files changed

+18
-1
lines changed

5 files changed

+18
-1
lines changed

helm/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bin

helm/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: sql-exporter
33
description: Database agnostic SQL exporter for Prometheus
44
type: application
5-
version: 0.2.2
5+
version: 0.2.3
66
appVersion: 0.13.0
77
keywords:
88
- exporter

helm/Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
LOCALBIN ?= $(shell pwd)/bin
2+
$(LOCALBIN):
3+
mkdir -p $(LOCALBIN)
4+
5+
.PHONY: gen_docs
6+
gen_docs: ## Generate helm documentation
7+
test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install github.com/norwoodj/helm-docs/cmd/helm-docs@latest
8+
./bin/helm-docs --template-files=./README.md.gotmpl --sort-values-order file

helm/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,7 @@ helm install sql_exporter/sql-exporter
6969
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.
7070

7171
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).
72+
73+
## Dev Notes
74+
75+
After updating default `Values`, please execute `make gen_docs` to update the `README.md` file

helm/README.md.gotmpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,7 @@ helm install sql_exporter/sql-exporter
6060
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.
6161

6262
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).
63+
64+
## Dev Notes
65+
66+
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 commit comments

Comments
 (0)