2021-10-17 19:39:02 +02:00
|
|
|
go/dependencies:
|
2021-02-08 19:49:48 +01:00
|
|
|
cd src/ && go mod download
|
2021-02-05 23:49:47 +01:00
|
|
|
|
|
|
|
# Make sure no unnecessary dependencies are present
|
2021-10-17 19:39:02 +02:00
|
|
|
go/checkDependencies:
|
2021-02-08 19:49:48 +01:00
|
|
|
cd src/ && go mod tidy -v
|
2021-02-05 23:49:47 +01:00
|
|
|
git diff-index --quiet HEAD
|
|
|
|
|
2021-10-17 19:39:02 +02: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 11:46:25 +01:00
|
|
|
|
2021-10-17 19:39:02 +02:00
|
|
|
docs/genChangelog:
|
2021-08-30 19:07:20 +02:00
|
|
|
./tools/git-chglog_linux_amd64 --config tools/chglog/config.yml 0.0.0.. > CHANGELOG_gen.md
|
2021-02-07 12:15:41 +01:00
|
|
|
|
2021-02-07 11:46:25 +01:00
|
|
|
build/snapshot:
|
|
|
|
./tools/goreleaser_linux_amd64 --snapshot --rm-dist --skip-publish
|
|
|
|
|
|
|
|
build/release:
|
|
|
|
./tools/goreleaser_linux_amd64 --rm-dist --skip-publish
|
2021-02-07 14:04:24 +01:00
|
|
|
|
|
|
|
build/docker:
|
2022-02-20 09:46:40 +01:00
|
|
|
cd src/ && go build -o fail2ban_exporter \
|
2021-02-08 20:48:55 +01: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 19:39:02 +02:00
|
|
|
docker/build/latest:
|
2021-02-07 14:04:24 +01:00
|
|
|
docker build -t registry.gitlab.com/hectorjsmith/fail2ban-prometheus-exporter:latest .
|
|
|
|
|
2022-02-12 18:31:01 +01:00
|
|
|
docker/build/nightly:
|
|
|
|
docker build -t registry.gitlab.com/hectorjsmith/fail2ban-prometheus-exporter:nightly .
|
|
|
|
|
2021-10-17 19:39:02 +02:00
|
|
|
docker/build/tag:
|
2021-02-07 14:04:24 +01:00
|
|
|
docker build -t registry.gitlab.com/hectorjsmith/fail2ban-prometheus-exporter:$(shell git describe --tags) .
|