2020-02-21 04:39:03 +00:00
|
|
|
GO ?= go
|
|
|
|
|
2020-09-12 15:23:25 +00:00
|
|
|
VERSION ?= $(shell git describe --tags --always | sed 's/-/+/' | sed 's/^v//')
|
2020-02-21 04:39:03 +00:00
|
|
|
|
|
|
|
.PHONY: build
|
|
|
|
build:
|
2021-03-11 05:21:23 +00:00
|
|
|
$(GO) build -ldflags '-s -w -X "go.jolheiser.com/vanity/router.Version=$(VERSION)"'
|
2020-02-21 04:39:03 +00:00
|
|
|
|
|
|
|
.PHONY: fmt
|
2021-03-11 05:21:23 +00:00
|
|
|
fmt: fmt-cli fmt-lib
|
2020-02-21 04:39:03 +00:00
|
|
|
|
|
|
|
.PHONY: test
|
2021-03-11 05:21:23 +00:00
|
|
|
test: test-cli test-lib
|
|
|
|
|
|
|
|
.PHONY: fmt-cli
|
|
|
|
fmt-cli:
|
|
|
|
$(GO) fmt ./...
|
|
|
|
|
|
|
|
.PHONY: test-cli
|
|
|
|
test-cli:
|
|
|
|
$(GO) test -race ./...
|
|
|
|
|
|
|
|
.PHONY: fmt-lib
|
|
|
|
fmt-lib:
|
|
|
|
@cd go-vanity && $(GO) fmt ./...
|
|
|
|
|
|
|
|
.PHONY: test-lib
|
|
|
|
test-lib:
|
|
|
|
@cd go-vanity && $(GO) test -race ./...
|
2020-02-21 04:39:03 +00:00
|
|
|
|
2020-09-12 15:23:25 +00:00
|
|
|
.PHONY: vet
|
|
|
|
vet:
|
|
|
|
$(GO) vet ./...
|
2020-02-21 04:39:03 +00:00
|
|
|
|
2020-09-12 15:23:25 +00:00
|
|
|
.PHONY: docker-build
|
|
|
|
docker-build:
|
|
|
|
docker build -f docker/Dockerfile -t jolheiser/vanity .
|
2020-02-21 04:39:03 +00:00
|
|
|
|
2020-09-12 15:23:25 +00:00
|
|
|
.PHONY: docker-push
|
|
|
|
docker-push:
|
|
|
|
docker push jolheiser/vanity
|