2023-06-19 21:06:18 +02:00
|
|
|
.PHONY: download test fmt check/dependencies check/fmt build build/docker
|
|
|
|
|
2023-06-19 20:37:27 +02:00
|
|
|
download:
|
2023-06-19 19:58:16 +02:00
|
|
|
go mod download
|
2021-02-05 23:49:47 +01:00
|
|
|
|
2023-06-19 20:37:27 +02:00
|
|
|
test: download
|
2023-06-19 19:58:16 +02:00
|
|
|
go test ./... -v -race
|
2021-10-17 19:39:02 +02:00
|
|
|
|
2023-06-19 20:37:27 +02:00
|
|
|
fmt: download
|
2023-06-19 19:58:16 +02:00
|
|
|
go fmt ./...
|
2021-10-17 19:39:02 +02:00
|
|
|
|
2023-06-19 20:37:27 +02:00
|
|
|
check/dependencies: download
|
|
|
|
go mod tidy -v
|
|
|
|
git diff-index --quiet HEAD
|
2021-02-07 14:04:24 +01:00
|
|
|
|
2023-06-19 20:37:27 +02:00
|
|
|
check/fmt: download
|
|
|
|
test -z $(shell gofmt -l .)
|
2022-02-12 18:31:01 +01:00
|
|
|
|
2023-06-19 20:37:27 +02:00
|
|
|
build:
|
|
|
|
go build \
|
|
|
|
-ldflags "\
|
|
|
|
-X main.version=${shell git describe --tags} \
|
|
|
|
-X main.commit=${shell git rev-parse HEAD} \
|
|
|
|
-X main.date=${shell date --iso-8601=seconds} \
|
|
|
|
-X main.builtBy=manual \
|
|
|
|
" \
|
|
|
|
-o fail2ban_exporter \
|
|
|
|
exporter.go
|
2023-06-19 21:06:18 +02:00
|
|
|
|
|
|
|
build/docker: build
|
|
|
|
docker build -t fail2ban-prometheus-exporter .
|