-
Notifications
You must be signed in to change notification settings - Fork 38
/
Makefile
61 lines (48 loc) · 1.76 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
MYOS ?= ../myos
MYOS_REPOSITORY ?= $(patsubst %/$(APP),%/myos,$(APP_REPOSITORY))
APP ?= $(lastword $(subst /, ,$(APP_REPOSITORY)))
APP_REPOSITORY ?= $(shell git config --get remote.origin.url 2>/dev/null)
-include $(MYOS)/make/include.mk
$(MYOS):
-@git clone $(MYOS_REPOSITORY) $(MYOS)
SHELL_FILES ?= $(wildcard .*/*.sh */*.sh */*/*.sh)
.PHONY: all
all: install tests
.PHONY: install
install: myos build player up
echo "Welcome to myos docker land - make a user - make a player -"
.PHONY: migrate
migrate-%: home := ~/.zen/game/players
migrate-%:
if $(SUDO) test ! -d /var/lib/docker/volumes/$(HOSTNAME)_$*; then \
$(RUN) $(SUDO) mkdir -p /var/lib/docker/volumes/$(HOSTNAME)_$* \
&& $(RUN) $(SUDO) cp -a $(if $($*),$($*)/,~/.$*/) /var/lib/docker/volumes/$(HOSTNAME)_$*/_data \
&& $(RUN) $(SUDO) chown -R $(HOST_UID):$(HOST_GID) /var/lib/docker/volumes/$(HOSTNAME)_$*/_data \
; \
fi
.PHONY: player
player: STACK := User
player: docker-network-create-$(USER)
$(call make,stack-User-$(if $(DELETE),down,up),$(MYOS),$(PLAYER_MAKE_VARS))
.PHONY: player-%
player-%: STACK := User
player-%:
$(if $(filter $*,$(filter-out %-%,$(patsubst docker-compose-%,%,$(filter docker-compose-%,$(MAKE_TARGETS))))), \
$(call make,stack-User-$*,$(MYOS),$(PLAYER_MAKE_VARS)) \
)
.PHONY: upgrade
upgrade: migrate-home migrate-ipfs install
## TESTS
.PHONY: check
check:
shellcheck $(SHELL_FILES) ||:
.PHONY: shellcheck-%
shellcheck-%:
shellcheck $*/*.sh
.PHONY: shellspec
specs: shellspec-specs;
.PHONY: shellspec-%
shellspec-%:
shellspec -f tap $*
.PHONY: tests
tests: check specs