File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -77,18 +77,9 @@ scanner-docs: ## Generate documentation for scanners.
7777operator-docs : # # Generate documentation for the operator.
7878 $(BIN_DIR ) /generate-docs.sh --operator $(OPERATOR_DIR ) /Chart.yaml $(HELM_DOCS_DIR )
7979
80- # FIXME: #754 Remove .ONESHELL which is unsupported on some systems
8180.PHONY : auto-discovery-docs
82- .ONESHELL :
8381auto-discovery-docs : # # Generate documentation for the auto-discovery.
84- cd auto-discovery/kubernetes
85- if [ -d " docs" ]; then
86- echo " Docs Folder found at: auto-discovery/kubernetes/docs"
87- helm-docs --template-files=$(HELM_DOCS_DIR ) /templates.gotmpl --template-files=.helm-docs.gotmpl --template-files=$(HELM_DOCS_DIR ) /README.DockerHub-Core.md.gotmpl --output-file=docs/README.DockerHub-Core.md
88- helm-docs --template-files=$(HELM_DOCS_DIR ) /templates.gotmpl --template-files=.helm-docs.gotmpl --template-files=$(HELM_DOCS_DIR ) /README.ArtifactHub.md.gotmpl --output-file=docs/README.ArtifactHub.md
89- else
90- echo " Ignoring Docs creation process for Chart $$ dir, because no ` docs` folder found at: auto-discovery/kubernetes/docs"
91- fi
82+ $(BIN_DIR ) /generate-docs.sh --operator $(AUTO_DISCOVERY_DIR ) /kubernetes/Chart.yaml $(HELM_DOCS_DIR )
9283
9384.PHONY : demo-target-docs
9485demo-target-docs : # # Generate documentation for demo targets.
Original file line number Diff line number Diff line change @@ -185,8 +185,28 @@ function generate_operator_docs() {
185185}
186186
187187function generate_auto_discovery_docs() {
188- error " Not implemented yet!"
189- exit 1
188+ log " Generating auto discovery docs for ${CHART_FILE} ..."
189+
190+ local auto_discovery_dir docs_dir
191+
192+ auto_discovery_dir=" $( dirname " ${CHART_FILE} " ) "
193+ docs_dir=" ${auto_discovery_dir} /docs"
194+
195+ if [ ! -d " ${docs_dir} " ]; then
196+ log " Ignoring docs creation process for '${CHART_FILE} ' because docs folder found at: '${docs_dir} '!"
197+ exit 0
198+ fi
199+
200+ generate_docs " ${auto_discovery_dir} " \
201+ " docs/README.DockerHub-Core.md" \
202+ " ${HELM_DOCS_DIR} /templates.gotmpl" \
203+ " ${auto_discovery_dir} .helm-docs.gotmpl" \
204+ " ${HELM_DOCS_DIR} /README.DockerHub-Core.md.gotmpl"
205+ generate_docs " ${auto_discovery_dir} " \
206+ " docs/README.ArtifactHub.md" \
207+ " ${HELM_DOCS_DIR} /templates.gotmpl" \
208+ " ${auto_discovery_dir} .helm-docs.gotmpl" \
209+ " ${HELM_DOCS_DIR} /README.ArtifactHub.md.gotmpl"
190210}
191211
192212function main() {
You can’t perform that action at this time.
0 commit comments