-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
46 lines (33 loc) · 1.09 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
.PHONY: help
REGISTRY?=ghcr.io/weaveworks-liquidmetal
IMAGE_NAME?=$(REGISTRY)/microvm-action-runner
help: ## Display this help.
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
##@ Build
.PHONY: build
build: ## Build the binary
go build .
.PHONY: docker-build
docker-build: ## Build the docker image
docker build -t $(IMAGE_NAME) .
.PHONY: docker-push
docker-push: ## Push the docker image
docker push $(IMAGE_NAME)
##@ Development
.PHONY: test
test: ## Run the tests
go test ./...
.PHONY: generate
generate: counterfeiter ## Generate test fakes
go generate ./...
##@ Tools
## Tool Binaries
COUNTERFEITER := $(LOCALBIN)/counterfeiter
## Location to install tools to
LOCALBIN ?= $(shell pwd)/bin
$(LOCALBIN):
mkdir -p $(LOCALBIN)
.PHONY: counterfeiter
counterfeiter: $(COUNTERFEITER) ## Install counterfeiter
$(COUNTERFEITER): $(LOCALBIN)
cd $(LOCALBIN); go build -o . github.com/maxbrunsfeld/counterfeiter/v6