2020-05-28 13:29:02 +02:00
|
|
|
all: bin/example
|
|
|
|
|
test: lint unit-test
|
|
|
|
|
|
|
|
|
|
PLATFORM=local
|
2021-06-28 13:29:38 -04:00
|
|
|
UTIL_TAG=1.16.5-alpine
|
2020-05-28 13:29:02 +02:00
|
|
|
|
|
|
|
|
.PHONY: bin/example
|
|
|
|
|
bin/example:
|
|
|
|
|
@docker build . --target bin \
|
|
|
|
|
--output bin/ \
|
|
|
|
|
--platform ${PLATFORM}
|
|
|
|
|
|
|
|
|
|
.PHONY: unit-test
|
|
|
|
|
unit-test:
|
|
|
|
|
@docker build . --target unit-test
|
|
|
|
|
|
2020-08-12 18:52:18 +02:00
|
|
|
.PHONY: unit-test-coverage
|
|
|
|
|
unit-test-coverage:
|
|
|
|
|
@docker build . --target unit-test-coverage \
|
|
|
|
|
--output coverage/
|
|
|
|
|
cat coverage/cover.out
|
|
|
|
|
|
2020-05-28 13:29:02 +02:00
|
|
|
.PHONY: lint
|
|
|
|
|
lint:
|
|
|
|
|
@docker build . --target lint
|
2021-06-28 13:29:38 -04:00
|
|
|
|
|
|
|
|
.PHONY: tidy
|
|
|
|
|
tidy:
|
|
|
|
|
@docker run -t -i -v `pwd`:/src --workdir /src --rm golang:${UTIL_TAG} /usr/local/go/bin/go mod tidy
|
|
|
|
|
|
|
|
|
|
.PHONY: init
|
|
|
|
|
init:
|
|
|
|
|
@docker run -t -i -v `pwd`:/src --workdir /src --rm golang:${UTIL_TAG} /usr/local/go/bin/go mod init
|