2020-02-19 05:18:36 +00:00
|
|
|
GO ?= go
|
2020-10-07 04:11:36 +00:00
|
|
|
VERSION ?= $(shell git describe --tags --always | sed 's/-/+/' | sed 's/^v//')
|
2020-02-19 05:18:36 +00:00
|
|
|
|
|
|
|
.PHONY: build
|
|
|
|
build:
|
2021-02-28 04:20:14 +00:00
|
|
|
$(GO) build -ldflags '-s -w -X "go.jolheiser.com/gpm/router.Version=$(VERSION)"'
|
|
|
|
|
|
|
|
.PHONY: lint
|
|
|
|
lint:
|
|
|
|
earth +lint-cli
|
|
|
|
earth +lint-lib
|
2020-02-19 05:18:36 +00:00
|
|
|
|
|
|
|
.PHONY: fmt
|
2021-02-28 04:20:14 +00:00
|
|
|
fmt: fmt-cli fmt-lib
|
2020-02-19 05:18:36 +00:00
|
|
|
|
|
|
|
.PHONY: test
|
2021-02-28 04:20:14 +00:00
|
|
|
test: test-cli test-lib
|
|
|
|
|
|
|
|
.PHONY: fmt-cli
|
|
|
|
fmt-cli:
|
|
|
|
$(GO) fmt ./...
|
|
|
|
|
|
|
|
.PHONY: test-cli
|
|
|
|
test-cli:
|
2020-02-19 05:18:36 +00:00
|
|
|
$(GO) test -race ./...
|
2021-02-28 04:20:14 +00:00
|
|
|
|
|
|
|
.PHONY: fmt-lib
|
|
|
|
fmt-lib:
|
|
|
|
@cd go-gpm && $(GO) fmt ./...
|
|
|
|
|
|
|
|
.PHONY: test-lib
|
|
|
|
test-lib:
|
|
|
|
@cd go-gpm && $(GO) test -race ./...
|
|
|
|
|
|
|
|
.PHONY: docker-build
|
|
|
|
docker-build:
|
|
|
|
docker build -f docker/Dockerfile -t jolheiser/gpm .
|
|
|
|
|
|
|
|
.PHONY: docker-push
|
|
|
|
docker-push: docker-build
|
|
|
|
docker push jolheiser/gpm
|