You've already forked prometheus-fail2ban-exporter
chore: rewrite make commands
This commit is contained in:
42
Makefile
42
Makefile
@ -1,30 +1,26 @@
|
||||
go/dependencies:
|
||||
download:
|
||||
go mod download
|
||||
|
||||
# Make sure no unnecessary dependencies are present
|
||||
go/checkDependencies:
|
||||
test: download
|
||||
go test ./... -v -race
|
||||
|
||||
fmt: download
|
||||
go fmt ./...
|
||||
|
||||
check/dependencies: download
|
||||
go mod tidy -v
|
||||
git diff-index --quiet HEAD
|
||||
|
||||
# Standard go test
|
||||
go/test:
|
||||
go test ./... -v -race
|
||||
|
||||
go/fmt:
|
||||
go fmt ./...
|
||||
|
||||
go/checkFmt:
|
||||
check/fmt: download
|
||||
test -z $(shell gofmt -l .)
|
||||
|
||||
build/docker:
|
||||
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) .
|
||||
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
|
||||
|
Reference in New Issue
Block a user