-
Notifications
You must be signed in to change notification settings - Fork 22
/
Makefile
66 lines (47 loc) · 1.81 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
all: files
SERVER = pwmarcz.pl
TEXTURES = img/sticks.auto.png img/tiles.auto.png img/center.auto.png img/winds.auto.png
ICONS = img/icon-16.auto.png img/icon-32.auto.png img/icon-96.auto.png
.PHONY: parcel
parcel: files
./node_modules/.bin/parcel --no-hmr index.html about.html
.PHONY: server
server:
cd server && yarn start
.PHONY: files
files: img/models.auto.glb $(ICONS)
img/tiles.auto.png: img/tiles.svg
inkscape $< --export-filename=$@ --export-width=512 --export-background=#ffffff --export-background-opacity=1
img/sticks.auto.png: img/sticks.svg
inkscape $< --export-filename=$@ --export-width=256 --export-height=512
img/center.auto.png: img/center.svg
inkscape $< --export-filename=$@ --export-width=512 --export-height=512
img/winds.auto.png: img/winds.svg
inkscape $< --export-filename=$@ --export-width=128 --export-height=64
img/icon-%.auto.png: img/icon.svg
inkscape $< --export-filename=$@ --export-width=$*
img/models.auto.glb: img/models.blend $(TEXTURES)
blender $< --background --python export.py -- $@
.PHONY: build
build: files
rm -rf build
./node_modules/.bin/parcel build *.html --public-url . --cache-dir .cache/build/ --dist-dir build/ --no-source-maps
.PHONY: build-server
build-server:
cd server && yarn build
.PHONY: staging
staging: build
rsync -rva --checksum --delete build/ $(SERVER):autotable/dist-staging/
.PHONY: release
release: build
git push -f origin @:refs/heads/release/client
rsync -rva --checksum --delete build/ $(SERVER):autotable/dist/
.PHONY: release-server
release-server: build-server
git push -f origin @:refs/heads/release/server
rsync -rva --checksum --delete --exclude node_modules/ server/ $(SERVER):autotable/server/
ssh $(SERVER) 'cd autotable/server && yarn'
ssh $(SERVER) 'sudo systemctl restart autotable-server.service'
.PHONY:
test:
cd server && yarn test