-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathMakefile
30 lines (23 loc) · 1018 Bytes
/
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
DOCKER_TAG=$(shell [[ -z "$(shell git tag --points-at HEAD)" ]] && git rev-parse --short HEAD || git tag --points-at HEAD)
.PHONY: run
run: build ## Run miniqueue docker image built from HEAD
docker run \
-v $(shell pwd)/testdata:/etc/miniqueue/certs \
-p 8080:8080 \
tomarrell/miniqueue:$(DOCKER_TAG) \
-cert /etc/miniqueue/certs/localhost.pem \
-key /etc/miniqueue/certs/localhost-key.pem \
-db /var/lib/miniqueue \
-human
.PHONY: build
build: ## Build a docker image with the git tag pointing to current HEAD or the current commit hash.
docker build . -t tomarrell/miniqueue:$(DOCKER_TAG)
.PHONY: bench
bench: ## Run Go benchmarks
go test -bench=. -run=$$^
## Help display.
## Pulls comments from beside commands and prints a nicely formatted
## display with the commands and their usage information.
.DEFAULT_GOAL := help
help: ## Prints this help
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'