forked from Azure/azure-storage-queue-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
39 lines (27 loc) · 1.16 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
PROJECT_NAME = azure-storage-queue-go
WORK_DIR = /go/src/github.com/Azure/${PROJECT_NAME}
GOX_ARCH = linux/amd64 windows/amd64 darwin/amd64
PACKAGE_PATH = ./2017-07-29/azqueue
define with_docker
WORK_DIR=$(WORK_DIR) docker-compose run --rm $(PROJECT_NAME) $(1)
endef
login: setup ## get a shell into the container
WORK_DIR=$(WORK_DIR) docker-compose run --rm --entrypoint /bin/bash $(PROJECT_NAME)
docker-compose:
which docker-compose
docker-build: docker-compose
WORK_DIR=$(WORK_DIR) docker-compose build --force-rm
docker-clean: docker-compose
WORK_DIR=$(WORK_DIR) docker-compose down
dep: docker-build #
$(call with_docker,dep ensure -v)
setup: clean docker-build dep ## setup environment for development
test: setup ## run go tests
$(call with_docker,go test -race -short -cover -v $(PACKAGE_PATH))
build: setup ## build binaries for the project
$(call with_docker,gox -osarch="$(GOX_ARCH)" $(PACKAGE_PATH))
all: setup test build
clean: docker-clean ## clean environment and binaries
rm -rf bin
help: ## display this help screen
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'