Skip to content

Commit

Permalink
deps: Pin crd-ref-docs binary with new make crd-ref-docs target
Browse files Browse the repository at this point in the history
This target is adapted from the `make golangci-lint` one in the Makefile
on the root project.

Signed-off-by: Víctor Cuadrado Juan <[email protected]>
  • Loading branch information
viccuad committed Jan 9, 2024
1 parent 88d35b2 commit 3edfbb7
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion docs/crds/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
BIN_DIR := $(abspath $(ROOT_DIR)/bin)

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
GOBIN=$(shell go env GOPATH)/bin
else
GOBIN=$(shell go env GOBIN)
endif

CRD_REF_DOCS_VER := v0.0.9
CRD_REF_DOCS_BIN := crd-ref-docs
CRD_REF_DOCS := $(BIN_DIR)/$(CRD_REF_DOCS_BIN)

crd-ref-docs: $(CRD_REF_DOCS)

$(CRD_REF_DOCS): ## Install crd-ref-docs
GOBIN=$(BIN_DIR) go install github.com/elastic/crd-ref-docs@$(CRD_REF_DOCS_VER)

.PHONY: generate
generate:
crd-ref-docs --config=config.yml --renderer=markdown --source-path=../../pkg/apis --output-path=CRD-docs-for-docs-repo.md
$(CRD_REF_DOCS) --log-level INFO --config=config.yml --renderer=markdown --source-path=../../pkg/apis --output-path=CRD-docs-for-docs-repo.md

0 comments on commit 3edfbb7

Please sign in to comment.