-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
101 lines (71 loc) · 3.79 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
REPO=jakmeier/paddlers
LOCAL=jakmeier/paddlers-local
DOT := $(shell command -v dot 2> /dev/null)
build-and-run: build
make run
build: debug-game-master-container debug-db-interface-container debug-frontend-container debug-keycloak-container
mobile: debug-game-master-container debug-db-interface-container mobile-frontend-container mobile-keycloak-container
make run
release: game-master-container db-interface-container frontend-container keycloak-container
run: docker-compose.local.yml
docker-compose -f $< up --no-start
docker cp ./local.env paddlers_game-master_1:/app/.env
docker cp ./local.env paddlers_db-interface_1:/app/.env
docker-compose -f $< up --no-recreate --no-build
upload-frontend-builder: frontend-builder
docker login; docker push $(REPO):frontend-builder
rust-container: Dockerfile
docker build --target RustBaseImg -t $(REPO):builder-base -f $< .
frontend-builder: paddlers-frontend/build.Dockerfile
docker build -t $(REPO):frontend-builder -f $< .
game-master-container: paddlers-game-master/Dockerfile rust-container
docker build --target GameMaster -t $(REPO):game-master-snapshot -f $< .
db-interface-container: paddlers-db-interface/Dockerfile rust-container
docker build --target DbInterface -t $(REPO):db-interface-snapshot -f $< .
debug-game-master-container: paddlers-game-master/debug.Dockerfile rust-container
docker build --target GameMaster -t $(LOCAL):game-master-snapshot -f $< .
debug-db-interface-container: paddlers-db-interface/debug.Dockerfile rust-container
docker build --target DbInterface -t $(LOCAL):db-interface-snapshot -f $< .
debug-frontend-container: paddlers-frontend/debug.Dockerfile translations
cd paddlers-frontend; wasm-pack build --debug
cd www; npm run build
docker build --target WebServer -t $(LOCAL):frontend-snapshot -f $< .
frontend-container: paddlers-frontend/Dockerfile rust-container
docker build --target WebServer -t $(REPO):frontend-snapshot -f $< .
mobile-frontend-container: paddlers-frontend/mobile.Dockerfile
docker build --target WebServer -t $(LOCAL):frontend-snapshot -f $< .
debug-keycloak-container: paddlers-keycloak/debug.Dockerfile
docker build --target KeyCloak -t $(LOCAL):keycloak-snapshot -f $< .
keycloak-container: paddlers-keycloak/Dockerfile
docker build --target KeyCloak -t $(REPO):keycloak-snapshot -f $< .
mobile-keycloak-container: paddlers-keycloak/mobile.Dockerfile
docker build --target KeyCloak -t $(LOCAL):keycloak-snapshot -f $< .
# When container are alrady running, use these for partial update
recreate-frontend: debug-frontend-container
docker-compose -f docker-compose.local.yml up -d --no-deps --build frontend
recreate-frontend-mobile: mobile-frontend-container
docker-compose -f docker-compose.local.yml up -d --no-deps --build frontend
recreate-db-interface: debug-db-interface-container
docker-compose -f docker-compose.local.yml up -d --no-deps --build db-interface
recreate-game-master: debug-game-master-container
docker-compose -f docker-compose.local.yml up -d --no-deps --build game-master
benchmark-file-sizes:
./paddlers-frontend/benchmarks/app_size_stats.sh
# Translations
paddlers-frontend/static/locale/%.mo: texts/%.po
msgfmt $< -o $@
.PHONY: translations
translations: paddlers-frontend/static/locale/en.mo paddlers-frontend/static/locale/de.mo
.PHONY: images
images:
$(MAKE) -C paddlers-frontend images
# Code generation
.PHONY: generate-files-from-specifications
generate-files-from-specifications:
cd specification-loader; cargo +nightly run -- generate enum ../paddlers-shared-lib/src/generated
cd specification-loader; cargo +nightly run -- generate chart ../specification
# If this fails, install graphviz (e.g. sudo apt-get install graphviz)
cd specification; dot -Tsvg story.dot > story.svg
.PHONY: check
check:
cd specification-loader; cargo +nightly run -- check ../specification