-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
37 lines (27 loc) · 1.12 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
export APP_NAME := $(notdir $(shell pwd))
DESC :=
PROJECT_URL := "https://github.com/gomatic/$(APP_NAME)"
.PHONY : buld ec2 run test
.PHONY : help
.DEFAULT_GOAL := help
PREFIX ?= usr/local
#
build: go/bin/counselor/counselor ## Build the consul-counselor container
docker build --tag gomatic/consul-counselor .
go/bin/counselor/counselor: go/bin/counselor
cd $(dir $^)/counselor && make linux GOOS=linux GOARCH=amd64 && mv counselor-linux-amd64 counselor
go/bin/counselor:
mkdir -p $(dir $@)
cd $(dir $@) && git clone https://github.com/gomatic/counselor
ec2: TAG ?= discovery
ec2: ## Run the container using EC2 tag-join. Use TAG= to assign a tag. default: TAG=discovery
docker run --rm -it -e "-retry-join-ec2-tag-value=$(TAG)" consul-counselor
run: ## Run the container. Needs to be with AWS.
docker run --rm -it consul-counselor
test: build ## Test the container
docker run --rm -it -e "COUNSELOR_MOCK=true" consul-counselor counselor test
help: ## This help.
@echo $(APP_NAME)
@echo $(PROJECT_URL)
@echo Targets:
@awk 'BEGIN {FS = ":.*?## "} / [#][#] / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)