2020-02-21 04:39:03 +00:00
|
|
|
GO ?= go
|
|
|
|
|
2020-09-10 17:27:46 +00:00
|
|
|
VERSION ?= $(shell git describe --tags --always | sed 's/-/+/' | sed 's/^v//')
|
2020-02-21 04:39:03 +00:00
|
|
|
|
|
|
|
.PHONY: build
|
|
|
|
build:
|
2020-09-12 01:38:18 +00:00
|
|
|
$(GO) build -ldflags '-s -w -X "go.jolheiser.com/vanity/api.Version=$(VERSION)"'
|
2020-02-21 04:39:03 +00:00
|
|
|
|
|
|
|
.PHONY: fmt
|
|
|
|
fmt:
|
|
|
|
$(GO) fmt ./...
|
|
|
|
|
|
|
|
.PHONY: test
|
|
|
|
test:
|
2020-09-10 17:27:46 +00:00
|
|
|
$(GO) test --race ./...
|
2020-02-21 04:39:03 +00:00
|
|
|
|
2020-09-10 17:27:46 +00:00
|
|
|
.PHONY: vet
|
|
|
|
vet:
|
2020-09-12 01:38:18 +00:00
|
|
|
$(GO) vet ./...
|
|
|
|
|
|
|
|
.PHONY: docker-build
|
|
|
|
docker-build:
|
|
|
|
docker build -f docker/Dockerfile -t jolheiser/vanity .
|
|
|
|
|
|
|
|
.PHONY: docker-push
|
|
|
|
docker-push:
|
|
|
|
docker push jolheiser/vanity
|