forked from roost-io/ecserver
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
53 lines (44 loc) · 1.37 KB
/
Makefile
File metadata and controls
53 lines (44 loc) · 1.37 KB
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
47
48
49
50
51
52
53
ECSVR_IMG=ecserver
COMMITID := $(shell git rev-parse HEAD)
ifndef IMAGE_TAG
IMAGE_TAG=latest
endif
CLUSTER_IP := $(shell ping -W2 -n -q -c1 current-cluster-roost.io 2> /dev/null | awk -F '[()]' '/PING/ { print $$2}')
# HOSTNAME := $(shell hostname)
.PHONY: all
all: dockerise helm-deploy
.PHONY: test
test: test-ecserver
.PHONY: test-ecserver
test-ecserver:
echo "Test ECserver"
docker run --network="host" --rm -it -v ${PWD}/ecserver/test:/scripts \
zbio/artillery-custom \
run -e unit /scripts/test.yaml
.PHONY: dockerise
dockerise: build-ecserver
.PHONY: build-ecserver
build-ecserver:
ifdef DOCKER_HOST
docker -H ${DOCKER_HOST} build -t ${ECSVR_IMG}:${COMMITID} -f ecserver/Dockerfile ecserver
docker -H ${DOCKER_HOST} tag ${ECSVR_IMG}:${COMMITID} ${ECSVR_IMG}:${IMAGE_TAG}
else
docker build -t ${ECSVR_IMG}:${IMAGE_TAG} -f ecserver/Dockerfile ecserver
docker tag ${ECSVR_IMG}:${COMMITID} ${ECSVR_IMG}:${IMAGE_TAG}
endif
.PHONY: push
push:
docker tag ${ECSVR_IMG}:${IMAGE_TAG} zbio/${ECSVR_IMG}:${IMAGE_TAG}
docker push zbio/${ECSVR_IMG}:${IMAGE_TAG}
.PHONY: helm-deploy
helm-deploy:
ifeq ($(strip $(CLUSTER_IP)),)
@echo "UNKNOWN_CLUSTER_IP: failed to resolve current-cluster-roost.io to an valid IP"
@exit 1;
endif
helm install vote helm-vote --set clusterIP=$(CLUSTER_IP)
.PHONY: helm-undeploy
helm-undeploy:
-helm uninstall vote
.PHONY: clean
clean: helm-undeploy