2019-08-14 22:34:49 +02:00
|
|
|
GOPATH=$(shell pwd)/vendor:$(shell pwd)
|
|
|
|
GOBIN=$(shell pwd)/bin
|
|
|
|
GOFILES=$(wildcard *.go)
|
|
|
|
GONAME=$(shell basename "$(PWD)")
|
|
|
|
|
|
|
|
build: get
|
|
|
|
@echo "Building $(GOFILES) to ./bin"
|
2019-08-17 17:47:34 +02:00
|
|
|
@GOPATH=$(GOPATH) GOBIN=$(GOBIN) go build -v -o bin/$(GONAME) $(GOFILES)
|
2019-08-14 22:34:49 +02:00
|
|
|
|
|
|
|
get:
|
2019-08-17 17:47:34 +02:00
|
|
|
@GOPATH=$(GOPATH) GOBIN=$(GOBIN) go get -v .
|
2019-08-14 22:34:49 +02:00
|
|
|
|
|
|
|
install:
|
|
|
|
@GOPATH=$(GOPATH) GOBIN=$(GOBIN) go install $(GOFILES)
|
|
|
|
|
|
|
|
run: build
|
|
|
|
@GOPATH=$(GOPATH) GOBIN=$(GOBIN) go run $(GOFILES) --config=$(shell pwd)/smartctl_exporter.yaml --debug --verbose
|
|
|
|
|
|
|
|
run-sudo: build
|
|
|
|
sudo bin/$(GONAME) --config=$(shell pwd)/smartctl_exporter.yaml --debug --verbose
|
|
|
|
|
|
|
|
clear:
|
|
|
|
@clear
|
|
|
|
|
|
|
|
clean:
|
|
|
|
@echo "Cleaning"
|
|
|
|
@GOPATH=$(GOPATH) GOBIN=$(GOBIN) go clean
|
2019-08-17 12:18:48 +02:00
|
|
|
|
|
|
|
example:
|
|
|
|
@echo "# Example output" > EXAMPLE.md
|
2019-08-17 12:26:31 +02:00
|
|
|
@echo '```' >> EXAMPLE.md
|
2019-08-17 12:18:48 +02:00
|
|
|
@curl -s localhost:9633/metrics | grep smartctl >> EXAMPLE.md
|
2019-08-17 12:26:31 +02:00
|
|
|
@echo '```' >> EXAMPLE.md
|
2020-10-29 22:35:49 +01:00
|
|
|
|
|
|
|
collect_fake_json:
|
|
|
|
-mkdir debug
|
|
|
|
-rm -f debug/*json
|
|
|
|
sudo ./collect_fake_json.sh
|