2021-10-17 17:39:02 +00:00
|
|
|
go/dependencies:
|
2021-02-08 18:49:48 +00:00
|
|
|
cd src/ && go mod download
|
2021-02-05 22:49:47 +00:00
|
|
|
|
|
|
|
# Make sure no unnecessary dependencies are present
|
2021-10-17 17:39:02 +00:00
|
|
|
go/checkDependencies:
|
2021-02-08 18:49:48 +00:00
|
|
|
cd src/ && go mod tidy -v
|
2021-02-05 22:49:47 +00:00
|
|
|
git diff-index --quiet HEAD
|
|
|
|
|
2021-10-17 17:39:02 +00:00
|
|
|
# Standard go test
|
|
|
|
go/test:
|
|
|
|
cd src/ && go test ./... -v -race
|
|
|
|
|
|
|
|
go/fmt:
|
|
|
|
cd src/ && go fmt ./...
|
|
|
|
|
|
|
|
go/checkFmt:
|
|
|
|
test -z $(shell gofmt -l .)
|
2021-02-07 10:46:25 +00:00
|
|
|
|
2021-02-07 13:04:24 +00:00
|
|
|
build/docker:
|
2022-02-20 08:46:40 +00:00
|
|
|
cd src/ && go build -o fail2ban_exporter \
|
2021-02-08 19:48:55 +00:00
|
|
|
-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
|
|
|
|
|
2021-10-17 17:39:02 +00:00
|
|
|
docker/build/latest:
|
2021-02-07 13:04:24 +00:00
|
|
|
docker build -t registry.gitlab.com/hectorjsmith/fail2ban-prometheus-exporter:latest .
|
|
|
|
|
2022-02-12 17:31:01 +00:00
|
|
|
docker/build/nightly:
|
|
|
|
docker build -t registry.gitlab.com/hectorjsmith/fail2ban-prometheus-exporter:nightly .
|
|
|
|
|
2021-10-17 17:39:02 +00:00
|
|
|
docker/build/tag:
|
2021-02-07 13:04:24 +00:00
|
|
|
docker build -t registry.gitlab.com/hectorjsmith/fail2ban-prometheus-exporter:$(shell git describe --tags) .
|