From 3edfbb78f1dbde67d74753602c293b646fc27215 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Cuadrado=20Juan?= Date: Tue, 9 Jan 2024 11:44:22 +0100 Subject: [PATCH] deps: Pin crd-ref-docs binary with new `make crd-ref-docs` target MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This target is adapted from the `make golangci-lint` one in the Makefile on the root project. Signed-off-by: VĂ­ctor Cuadrado Juan --- docs/crds/Makefile | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/docs/crds/Makefile b/docs/crds/Makefile index 2ab9c9a3..8864b0ab 100644 --- a/docs/crds/Makefile +++ b/docs/crds/Makefile @@ -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