forked from emqxarchive/emqx-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
37 lines (28 loc) · 1013 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
31
32
33
34
35
36
37
DOCKER:=philipbui/emq-docker
CLUSTER:=emqtt
FILE_NAME:=emqtt.yaml
SECRET_FILE_NAME:=secret.yaml
NAME:=emqtt
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}'
build: ## Build Docker Container
docker build -t ${DOCKER} .
test: build ## Test Build
docker run -d --name ${NAME} -p 18083:18083 ${DOCKER}
sleep 10
curl -f 127.0.0.1:18083
make stop
run: ## Run Application
docker run --rm -ti --name ${NAME} -p 18083:18083 -p 1883:1883 ${DOCKER}
stop: ## Stop Application (if in Daemon)
docker stop ${NAME}
docker rm ${NAME}
cluster: ## Create Google Cloud Cluster and Authenticate
gcloud container clusters create ${CLUSTER}
gcloud container clusters get-credentials ${CLUSTER}
secret: ## Create Secret
kubectl create -f ${SECRET_FILE_NAME}
deploy: ## Deploy EMQTT to Kubernetes
kubectl apply -f ${FILE_NAME}
delete: ## Delete EMQTT in Kubernetes
kubectl delete -f ${FILE_NAME}