fail2ban-prometheus-exporter/Makefile

31 lines
859 B
Makefile
Raw Normal View History

go/dependencies:
2023-06-19 19:58:16 +02:00
go mod download
2021-02-05 23:49:47 +01:00
# Make sure no unnecessary dependencies are present
go/checkDependencies:
2023-06-19 19:58:16 +02:00
go mod tidy -v
2021-02-05 23:49:47 +01:00
git diff-index --quiet HEAD
# Standard go test
go/test:
2023-06-19 19:58:16 +02:00
go test ./... -v -race
go/fmt:
2023-06-19 19:58:16 +02:00
go fmt ./...
go/checkFmt:
test -z $(shell gofmt -l .)
build/docker:
2023-06-19 19:58:16 +02:00
go build -o fail2ban_exporter \
-ldflags '-X main.version=$(shell git describe --tags) -X main.commit=${shell git rev-parse HEAD} -X "main.date=${shell date --rfc-3339=seconds}" -X main.builtBy=docker' exporter.go
docker/build/latest:
docker build -t registry.gitlab.com/hectorjsmith/fail2ban-prometheus-exporter:latest .
docker/build/nightly:
docker build -t registry.gitlab.com/hectorjsmith/fail2ban-prometheus-exporter:nightly .
docker/build/tag:
docker build -t registry.gitlab.com/hectorjsmith/fail2ban-prometheus-exporter:$(shell git describe --tags) .