pushbits/Makefile
2021-07-18 23:14:32 +02:00

30 lines
595 B
Makefile

IMAGE := eikendev/pushbits
.PHONY: build
build:
mkdir -p ./out
go build -ldflags="-w -s" -o ./out/pushbits ./cmd/pushbits
.PHONY: test
test:
stdout=$$(gofmt -l . 2>&1); \
if [ "$$stdout" ]; then \
exit 1; \
fi
go vet ./...
gocyclo -over 10 $(shell find . -iname '*.go' -type f)
staticcheck ./...
go test -v -cover ./...
.PHONY: setup
setup:
go install github.com/fzipp/gocyclo/cmd/gocyclo@latest
go install honnef.co/go/tools/cmd/staticcheck@latest
.PHONY: build_image
build_image:
docker build -t ${IMAGE}:latest .
.PHONY: push_image
push_image:
docker push ${IMAGE}:latest