@@ -5,54 +5,52 @@ SERVICE_NAME := otel-collector
55SERVICE_VERSION := 0.5-$(shell git rev-parse --short HEAD)
66SERVICE_IMAGE := $(BASE_IMAGE_NAME ) /$(SERVICE_NAME ) :$(SERVICE_VERSION )
77
8- OTELCOL_VERSION := 0.120.0
9-
108KO_DOCKER_REPO := ghcr.io/zmoog/otel-collector-contrib
119
1210# ==============================================================================
1311# Define targets
1412
15- BUILD_DIR ?= _build
16- export GOBIN = $(shell realpath $(BUILD_DIR ) ) /_bin
13+ # BUILD_DIR ?= _build
14+ # export GOBIN = $(shell realpath $(BUILD_DIR))/_bin
1715
18- $(BUILD_DIR ) :
19- @mkdir -p $(BUILD_DIR )
16+ # $(BUILD_DIR):
17+ # @mkdir -p $(BUILD_DIR)
2018
21- $(GOBIN ) : tools/go.mod
22- cd tools && go install go.opentelemetry.io/collector/cmd/mdatagen
23- cd tools && go install go.opentelemetry.io/collector/cmd/builder
24- cd tools && go install golang.org/x/tools/cmd/goimports
25- cd tools && go install honnef.co/go/tools/cmd/staticcheck
19+ # $(GOBIN): tools/go.mod
20+ # cd tools && go install go.opentelemetry.io/collector/cmd/mdatagen
21+ # cd tools && go install go.opentelemetry.io/collector/cmd/builder
22+ # cd tools && go install golang.org/x/tools/cmd/goimports
23+ # cd tools && go install honnef.co/go/tools/cmd/staticcheck
2624
2725
2826.PHONY : generate
29- generate : $( GOBIN )
27+ generate :
3028 # look inside the receiver directory
3129 # and run mdatagen against the metadata.yaml
3230 # found there
33- find receiver -name go.mod -execdir $( GOBIN ) / mdatagen metadata.yaml \;
31+ find receiver -name go.mod -execdir go tool mdatagen metadata.yaml \;
3432
3533.PHONY : staticcheck
36- staticcheck : $( GOBIN )
34+ staticcheck :
3735 # run staticcheck for all go
3836 # directories that have a go.mod
3937 # file present
40- find . -name go.mod -execdir $( GOBIN ) / staticcheck ./... \;
38+ find . -name go.mod -execdir go tool staticcheck ./... \;
4139
4240.PHONY : fmt
43- fmt : $( GOBIN )
44- $( GOBIN ) / goimports -local github.com/zmoog/ -w .
41+ fmt :
42+ go tool goimports -local github.com/zmoog/ -w .
4543
4644.PHONY : generate-otelcol
47- generate-otelcol : $( GOBIN )
48- cd collector && $( GOBIN ) / builder --config builder-config.yaml
45+ generate-otelcol :
46+ cd collector && go tool builder --config builder-config.yaml
4947
5048.PHONY : run
5149run :
5250 cd collector/otelcol && ./otelcol --config ../../config.yaml
5351
5452.PHONY : service
55- service : $( GOBIN )
56- cd collector/otelcol && KO_DOCKER_REPO=$(KO_DOCKER_REPO ) $( GOBIN ) / ko build . \
53+ service :
54+ cd collector/otelcol && KO_DOCKER_REPO=$(KO_DOCKER_REPO ) go tool ko build . \
5755 --platform=linux/amd64,linux/arm64 \
5856 --bare
0 commit comments