-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathMakefile
More file actions
48 lines (37 loc) · 1.5 KB
/
Makefile
File metadata and controls
48 lines (37 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
test: generate manifests docs golint helm-test unit-test
PATHS ?= "./.../..."
manifests: controller-gen
$(CONTROLLER_GEN) crd rbac:roleName=manager-role webhook paths=${PATHS} output:crd:artifacts:config=config/crd/bases
cp config/crd/bases/*.haproxy.com*.yaml helm/haproxy-operator/crds/
generate: controller-gen
$(CONTROLLER_GEN) object:headerFile="hack\\boilerplate.go.txt" paths=${PATHS}
.PHONY: docs
docs: crd-docs-gen
$(CRD_DOCS) --config docs/config.yaml --renderer=markdown --output-path docs/api-reference.md --source-path=apis
golint: colanci-lint-bin
$(GOLANGCI_LINT) run
unit-test: ginkgo-bin
$(GINKGO) --no-color -r --randomize-all --randomize-suites --nodes=4 --compilers=4 --vet off
helm-test:
helm lint helm/haproxy-operator
helm template chart helm/haproxy-operator > /dev/null
CONTROLLER_GEN = bin/controller-gen
controller-gen:
$(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.20.1)
GOLANGCI_LINT = ./bin/golangci-lint
colanci-lint-bin:
$(call go-get-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.10.1)
CRD_DOCS = bin/crd-ref-docs
crd-docs-gen:
$(call go-get-tool,$(CRD_DOCS),github.com/elastic/crd-ref-docs@v0.3.0)
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
define go-get-tool
@[ -f $(1) ] || { \
set -e ;\
echo "Downloading $(2)" ;\
GOBIN=$(PROJECT_DIR)/bin go install $(2) ;\
}
endef
GINKGO = ./bin/ginkgo
ginkgo-bin:
$(call go-get-tool,$(GINKGO),github.com/onsi/ginkgo/v2/ginkgo@v2.28.1)