-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
87 lines (63 loc) · 1.47 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
SERVERS = 3
CLIENTS = 2
CONFIG = 1
# ----------------------------------------------------------------------
MAIN = Paxos.main
SINGLE_SETUP = single
DOCKER_SETUP = docker
SSH_SETUP = ssh
PROJECT = da347
NETWORK = $(PROJECT)_network
# run all clients, servers and top-level component in a single node
SINGLE = mix run --no-halt -e $(MAIN) $(CONFIG) $(SINGLE_SETUP) $(SERVERS) $(CLIENTS)
# run each client, server and top-level component in its own Docker container
GEN_YML = ./gen_yml.sh $(MAIN) $(CONFIG) $(DOCKER_SETUP) $(SERVERS) $(CLIENTS)
DOCKER = docker-compose -p $(PROJECT)
# run each client, server and top-level component on real hosts via ssh
SSH = MAIN=$(MAIN) CONFIG=$(CONFIG) SETUP=$(SSH_SETUP) SERVERS=$(SERVERS) CLIENTS=$(CLIENTS) ./ssh.sh
compile:
mix compile
clean:
mix clean
run:
$(SINGLE)
@echo ----------------------
gen:
$(GEN_YML)
up:
@make gen
$(DOCKER) up
down:
$(DOCKER) down
make show
ssh_up:
$(SSH) up
ssh_down:
$(SSH) down
ssh_show:
$(SSH) show
show:
@echo ----------------------
@make ps
@echo ----------------------
@make network
show2:
@echo ----------------------
@make ps2
@echo ----------------------
@make network
ps:
docker ps -a --format 'table {{.Names}}\t{{.Image}}'
ps2:
docker ps -a -s
network net:
docker network ls
inspect:
docker network inspect $(NETWORK)
netrm:
docker network rm $(NETWORK)
conrm:
docker rm $(ID)
kill:
docker rm -f `docker ps -a -q`
docker network rm $(NETWORK)