-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
53 lines (33 loc) · 794 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
export user ?= ylivnat
targets := build push clean status
SERVICES := gateway batch worker datastore
$(targets): $(SERVICES)
$(SERVICES):
$(MAKE) -C services/$@ $(MAKECMDGOALS)
services-dir:
@mkdir -p services
%.git:
git clone https://github.com/yarden-livnat/recyclus-$@ services/$*
clone: services-dir $(addsuffix .git,$(SERVICES))
#
# dev environments
#
dev: clone build
@echo dev environment ready
#
# docker swarm
#
define swarm-status
$(shell docker info | grep Swarm | sed 's/Swarm: //g')
endef
start:
ifeq ($(swarm-status),inactive)
docker swarm init
endif
docker stack deploy -c docker-stack.yml recyclus
docker service ls
stop:
docker stack rm recyclus
exit:
docker swarm leave --force
.PHONY: $(targets) $(SERVICES) services-dir dev clone start stop exit