-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathmakefile
More file actions
131 lines (116 loc) · 4.34 KB
/
makefile
File metadata and controls
131 lines (116 loc) · 4.34 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
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# Function to execute a command.
# Accepts command to execute as first parameter.
define exec-command
$(1)
endef
.PHONY: default
default:
cd stefc && make
cd go/pkg && make
cd go/grpc && make
cd go/otel && make
cd go/pdata && make
cd otelcol && make
cd examples && make
cd benchmarks && make
.PHONY: all
all: docs-validate
cd stefc && make all
cd go/pkg && make all
cd go/grpc && make all
cd go/otel && make all
cd go/pdata && make all
cd otelcol && make all
cd examples && make all
cd benchmarks && make all
.PHONY: build-ci
build-ci: docs-install-deps docs-validate
cd stefc && make all
cd go/pkg && make all
cd go/grpc && make
cd go/otel && make all
cd go/pdata && make all
cd otelcol && make all
cd examples && make
cd benchmarks && make build-ci
.PHONY: verifyver
verifyver:
ifndef VERSION
@echo "VERSION is unset or set to the empty string"
@exit 1
endif
RELEASE_MODULES := go/pkg go/grpc go/otel go/pdata
ALL_MODULES += $(RELEASE_MODULES) stefc stefc/generator/testdata examples/jsonl examples/profile examples/ints otelcol benchmarks
.PHONY: gotidy
gotidy:
$(foreach gomod,$(ALL_MODULES),$(call exec-command,cd $(gomod) && go mod tidy))
.PHONY: prepver
prepver: verifyver
echo Updating to version ${VERSION}
cd go/grpc && go mod edit -require=github.com/splunk/stef/go/pkg@${VERSION}
cd go/otel && go mod edit -require=github.com/splunk/stef/go/pkg@${VERSION} \
&& go mod edit -require=github.com/splunk/stef/go/grpc@${VERSION}
cd go/pdata && go mod edit -require=github.com/splunk/stef/go/pkg@${VERSION} \
&& go mod edit -require=github.com/splunk/stef/go/otel@${VERSION}
cd stefc && go mod edit -require=github.com/splunk/stef/go/pkg@${VERSION}
cd stefc/generator/testdata && go mod edit -require=github.com/splunk/stef/go/pkg@${VERSION}
cd examples/jsonl && go mod edit -require=github.com/splunk/stef/go/pkg@${VERSION}
cd examples/profile && go mod edit -require=github.com/splunk/stef/go/pkg@${VERSION}
$(foreach gomod,$(ALL_MODULES),$(call exec-command,cd $(gomod) && go mod tidy))
.PHONY: releasever
releasever: verifyver
echo Tagging version $(VERSION)
$(foreach gomod,$(RELEASE_MODULES),$(call exec-command,git tag $(gomod)/$(VERSION) && git push origin $(gomod)/$(VERSION)))
# Docs validation targets
.PHONY: docs-validate docs-validate-html docs-validate-css docs-check-links docs-install-deps
# Validate all docs (HTML, CSS, and links)
docs-validate: docs-validate-html docs-validate-css docs-check-links
@echo "✅ All docs validation checks passed!"
# Validate HTML files in docs directory
docs-validate-html:
@echo "🔍 Validating HTML files in docs..."
@cd docs && for file in *.html; do \
if [ -f "$$file" ] && [ "$$file" != "benchmarks.html" ]; then \
echo "Validating $$file..."; \
../node_modules/.bin/html-validate "$$file" || (echo "❌ HTML validation failed for $$file" && exit 1); \
elif [ -f "$$file" ] && [ "$$file" = "benchmarks.html" ]; then \
echo "Skipping validation for $$file (excluded)"; \
fi; \
done
@echo "✅ HTML validation complete"
# Validate CSS files in docs directory
docs-validate-css:
@echo "🔍 Validating CSS files in docs..."
@cd docs && for file in *.css; do \
if [ -f "$$file" ]; then \
echo "Validating $$file..."; \
../node_modules/.bin/stylelint "$$file" --config-basedir .. || (echo "❌ CSS validation failed for $$file" && exit 1); \
fi; \
done
@echo "✅ CSS validation complete"
# Check links in HTML files
docs-check-links:
@for file in docs/*.html; do \
if [ -f "$$file" ]; then \
echo "Checking links in $$(basename $$file)..."; \
./node_modules/.bin/markdown-link-check "$$file" --quiet || true; \
echo " ✅ Link check completed for $$(basename $$file)"; \
fi; \
done
@echo "✅ Link checking complete"
# Install npm-based validation dependencies for docs
docs-install-deps:
@echo "📦 Installing npm-based validation dependencies at top level..."
@if ! command -v npm >/dev/null 2>&1; then \
echo "❌ npm not found. Please install Node.js and npm first."; \
echo "Visit: https://nodejs.org/"; \
exit 1; \
fi
@if [ ! -f package.json ]; then \
echo "❌ package.json not found. Cannot install dependencies."; \
exit 1; \
fi
@echo "Installing all dependencies from package.json..."
@npm install
@echo "✅ All docs dependencies installed successfully!"
@echo "Tools installed in ./node_modules/.bin/"