-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
25 lines (22 loc) · 876 Bytes
/
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
OS := $(shell uname)
.PHONY: otelcol
otelcol:
go build -o otelcol ./cmd
check_builder_exist:
@if command -v builder >/dev/null 2>&1; then \
echo "using builder to generate otelcol code"; \
else \
echo "builder is not installed. Installed it with: go install go.opentelemetry.io/collector/cmd/builder@v0.103.1"; \
exit 1; \
fi
.PHONY: otelcol-cmd
otelcol-cmd: check_builder_exist
builder --config=./.builder/otelcol-builder.yaml --skip-compilation
@mv ./cmd/go.mod go.mod && mv ./cmd/go.sum go.sum
ifeq ($(OS), Darwin)
@sed -i '' 's#module go.opentelemetry.io/collector/cmd/builder#module github.com/CloudDetail/apo-otel-collector#g' go.mod
@sed -i '' 's#=> ../pkg/#=> ./pkg/#g' go.mod
else
@sed -i 's#module go.opentelemetry.io/collector/cmd/builder#module github.com/CloudDetail/apo-otel-collector#g' go.mod
@sed -i 's#=> ../pkg/#=> ./pkg/#g' go.mod
endif