flokati/Makefile

37 lines
899 B
Makefile
Raw Permalink Normal View History

2023-06-13 08:24:01 +00:00
all: test fmt build
test:
go test ./...
vet:
go vet ./...
fmt:
2024-07-06 21:55:40 +00:00
go fmt ./...
#go list -f '{{.Dir}}' ./... | grep -v /vendor/ | xargs -L1 gofmt -l
2024-07-05 09:58:57 +00:00
#test -z $$(go list -f '{{.Dir}}' ./... | grep -v /vendor/ | xargs -L1 gofmt -l)
2023-06-13 08:24:01 +00:00
lint:
go list ./... | grep -v /vendor/ | xargs -L1 golint -set_exit_status
2024-07-06 21:55:40 +00:00
build: fmt
2024-07-05 09:58:57 +00:00
go build -v -a -o bin/flokati ./cmd/flokati
2024-07-06 21:55:40 +00:00
VERSIONGO=cmd/flokati/version.go
REV=$$(git rev-list HEAD --count)
BUILDDATE=$$(date)
BRANCH=$$(git rev-parse --abbrev-ref HEAD)
TAGS=.tags
docker: fmt
echo "package main" >$(VERSIONGO)
echo "" >>$(VERSIONGO)
echo "const (" >>$(VERSIONGO)
echo " Version = \"$(BRANCH)\"" >>$(VERSIONGO)
echo " Build = \"$(REV)\"" >>$(VERSIONGO)
echo " Builddate = \"$(BUILDDATE)\"" >>$(VERSIONGO)
echo ")" >>$(VERSIONGO)
echo -n "$(BRANCH)-$(REV)" >$(TAGS)
2024-07-05 09:58:57 +00:00
docker build -t dr.dnix.de/flokati .
docker push dr.dnix.de/flokati