forked from elastic/opentelemetry-collector-components
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
76 lines (57 loc) · 1.89 KB
/
Makefile
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
include ./Makefile.Common
# All source code and documents. Used in spell check.
ALL_DOC := $(shell find . \( -name "*.md" -o -name "*.yaml" \) \
-type f | sort)
# ALL_MODULES includes ./* dirs (excludes . dir)
ALL_MODULES := $(shell find . -type f -name "go.mod" -exec dirname {} \; | sort | grep -E '^./' )
GROUP ?= all
FOR_GROUP_TARGET=for-$(GROUP)-target
.DEFAULT_GOAL := all
.PHONY: all
all: misspell
# Append root module to all modules
GOMODULES = $(ALL_MODULES)
# Define a delegation target for each module
.PHONY: $(GOMODULES)
$(GOMODULES):
@echo "Running target '$(TARGET)' in module '$@'"
$(MAKE) -C $@ $(TARGET)
# Triggers each module's delegation target
.PHONY: for-all-target
for-all-target: $(GOMODULES)
.PHONY: gomoddownload
gomoddownload:
@$(MAKE) $(FOR_GROUP_TARGET) TARGET="moddownload"
.PHONY: gotest
gotest:
@$(MAKE) $(FOR_GROUP_TARGET) TARGET="test"
.PHONY: golint
golint:
@$(MAKE) $(FOR_GROUP_TARGET) TARGET="lint"
.PHONY: golicense
golicense:
@$(MAKE) $(FOR_GROUP_TARGET) TARGET="license-check"
.PHONY: gofmt
gofmt:
@$(MAKE) $(FOR_GROUP_TARGET) TARGET="fmt"
.PHONY: gotidy
gotidy:
@$(MAKE) $(FOR_GROUP_TARGET) TARGET="tidy"
.PHONY: gogenerate
gogenerate:
@$(MAKE) $(FOR_GROUP_TARGET) TARGET="generate"
@$(MAKE) $(FOR_GROUP_TARGET) TARGET="fmt"
.PHONY: gogovulncheck
gogovulncheck:
$(MAKE) $(FOR_GROUP_TARGET) TARGET="govulncheck"
.PHONY: goporto
goporto:
$(MAKE) $(FOR_GROUP_TARGET) TARGET="porto"
# Build a collector based on the Elastic components (generate Elastic collector)
.PHONY: genelasticcol
genelasticcol: $(BUILDER)
$(BUILDER) --config ./distributions/elastic-components/manifest.yaml
# Validate that the Elastic components collector can run with the example configuration.
.PHONY: elasticcol-validate
elasticcol-validate: genelasticcol
./_build/elastic-collector-components validate --config ./distributions/elastic-components/config.yaml