-
Notifications
You must be signed in to change notification settings - Fork 112
Expand file tree
/
Copy pathMakefile
More file actions
53 lines (39 loc) · 1.42 KB
/
Makefile
File metadata and controls
53 lines (39 loc) · 1.42 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
#
# Deis Makefile
#
ifndef DEIS_NUM_INSTANCES
DEIS_NUM_INSTANCES = 1
endif
define ssh_all
i=1 ; while [ $$i -le $(DEIS_NUM_INSTANCES) ] ; do \
vagrant ssh deis-$$i -c $(1) ; \
i=`expr $$i + 1` ; \
done
endef
# ordered list of deis components
# we don't manage the router if we're setting up a local cluster
ifeq ($(DEIS_NUM_INSTANCES),1)
COMPONENTS=builder cache controller database logger registry router
else
COMPONENTS=builder cache controller database logger registry
endif
all: build run
pull:
$(call ssh_all,'for c in $(COMPONENTS); do docker pull deis/$$c; done')
build:
$(call ssh_all,'cd share && for c in $(COMPONENTS); do cd $$c && docker build -t deis/$$c . && cd ..; done')
install:
for c in $(COMPONENTS); do fleetctl --strict-host-key-checking=false submit $$c/systemd/*; done
uninstall: stop
for c in $(COMPONENTS); do fleetctl --strict-host-key-checking=false destroy $$c/systemd/*; done
start:
echo "\033[0;33mStarting services can take some time... grab some coffee!\033[0m"
for c in $(COMPONENTS); do fleetctl --strict-host-key-checking=false start $$c/systemd/*; done
stop:
for c in $(COMPONENTS); do fleetctl --strict-host-key-checking=false stop $$c/systemd/*; done
restart: stop start
run: install start
clean: uninstall
$(call ssh_all,'for c in $(COMPONENTS); do docker rm -f deis-$$c; done')
full-clean: clean
$(call ssh_all,'for c in $(COMPONENTS); do docker rmi deis-$$c; done')