-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
75 lines (63 loc) · 2.3 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
gethVersion=v1.9.15
nginx=sebohe/nginx-eth:latest
project=testnets
flags=.makeFlags
VPATH=$(flags)
$(shell mkdir -p $(flags))
default: deploy
clean:
rm -rf $(flags)
nginx:
docker build -f ops/nginx/Dockerfile -t $(nginx) ./ops/nginx
geth:
docker pull ethereum/client-go:$(gethVersion)
touch $(flags)/$@
binance:
docker pull hashcloak/binance:latest
touch $(flags)/$@
config:
@read -p 'Domain to register: ' bridge; \
echo "DOMAIN_URL="$$bridge > config
@read -p 'Subdomains to register sperate by a space. Specify atleast one: ' email; \
echo "SUBDOMAINS="$$email >> config
@read -p 'Email for SSL certificate (default [email protected]): ' email; \
echo "CERTBOT_EMAIL="$$email >> config
@touch $(flags)/$@
@echo "MAKE: Done with $@"
@echo
deploy: config nginx geth
GETH_IMAGE=ethereum/client-go:$(gethVersion) \
NGINX_IMAGE=$(nginx) \
DOMAIN_URL=$(shell cat config | grep DOMAIN_URL | cut -f2 -d=) \
EMAIL=$(shell cat config | grep CERTBOT_EMAIL | cut -f2 -d=) \
SUBDOMAINS='$(shell cat config | grep SUBDOMAINS | cut -f2 -d=)' \
docker stack deploy -c ops/ethereums-testnets.yml $(project)
monitoring-up: config nginx geth
GETH_IMAGE=ethereum/client-go:$(gethVersion) \
NGINX_IMAGE=$(nginx) \
DOMAIN_URL=$(shell cat config | grep DOMAIN_URL | cut -f2 -d=) \
EMAIL=$(shell cat config | grep CERTBOT_EMAIL | cut -f2 -d=) \
SUBDOMAINS='$(shell cat config | grep SUBDOMAINS | cut -f2 -d=)' \
docker stack deploy \
-c ops/ethereums-testnets.yml \
-c ops/testnets-monitoring.yml $(project)
binance-up: config binance nginx geth
GETH_IMAGE=ethereum/client-go:$(gethVersion) \
NGINX_IMAGE=$(nginx) \
DOMAIN_URL=$(shell cat config | grep DOMAIN_URL | cut -f2 -d=) \
EMAIL=$(shell cat config | grep CERTBOT_EMAIL | cut -f2 -d=) \
SUBDOMAINS='$(shell cat config | grep SUBDOMAINS | cut -f2 -d=)' \
docker stack deploy \
-c ops/ethereums-testnets.yml \
-c ops/testnets-minitoring.yml \
-c ops/binance.yml $(project)
down:
docker stack rm $(project)
docker stack rm dev_$(project)
while [ -n "`docker network ls --quiet --filter label=com.docker.stack.namespace=$(project)`" ]; do echo -n '.' && sleep 1; done
@echo
while [ -n "`docker network ls --quiet --filter label=com.docker.stack.namespace=dev_$(project)`" ]; do echo -n '.' && sleep 1; done
@echo "MAKE: Done with $@"
@echo
r:
make down && make