2021-02-05 22:49:47 +00:00
|
|
|
install-deps:
|
2021-02-08 18:49:48 +00:00
|
|
|
cd src/ && go mod download
|
2021-02-05 22:49:47 +00:00
|
|
|
|
|
|
|
# Standard go test
|
|
|
|
test:
|
2021-02-08 18:49:48 +00:00
|
|
|
cd src/ && go test ./... -v -race
|
2021-02-05 22:49:47 +00:00
|
|
|
|
|
|
|
# Make sure no unnecessary dependencies are present
|
|
|
|
go-mod-tidy:
|
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
|
|
|
|
|
|
|
|
format:
|
2021-02-08 18:49:48 +00:00
|
|
|
cd src/ && go fmt $(go list ./... | grep -v /vendor/)
|
|
|
|
cd src/ && go vet $(go list ./... | grep -v /vendor/)
|
2021-02-07 10:46:25 +00:00
|
|
|
|
2021-02-07 11:15:41 +00:00
|
|
|
generateChangelog:
|
|
|
|
./tools/git-chglog_linux_amd64 --config tools/chglog/config.yml 0.0.0.. > CHANGELOG.md
|
|
|
|
|
2021-02-07 10:46:25 +00: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 13:04:24 +00:00
|
|
|
|
|
|
|
build/docker:
|
2021-02-08 19:48:55 +00:00
|
|
|
cd src/ && go build -o 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:
|
2021-02-07 13:04:24 +00:00
|
|
|
docker build -t registry.gitlab.com/hectorjsmith/fail2ban-prometheus-exporter:latest .
|
|
|
|
|
2021-02-08 19:48:55 +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) .
|