Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add a make rule to generate helm docs #398

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions helm/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bin
2 changes: 1 addition & 1 deletion helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: sql-exporter
description: Database agnostic SQL exporter for Prometheus
type: application
version: 0.2.2
version: 0.2.3
appVersion: 0.13.0
keywords:
- exporter
Expand Down
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.