forked from UweSchmidt/hayoo-json
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
55 lines (41 loc) · 1.17 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
SERVER = http://localhost:3000
JSONDIR = json
NEWJSONDIR = newJson
JSONFILES = $(wildcard $(JSONDIR)/*.js)
PACK_FILE_SIZE = 30
.PHONY: all clean clean-packed
clean: clean-packed
- rm -f hayooContexts.js
hayooContexts.js: makeJs.py
./makeJs.py --contexts hayooContexts.js
insert-package: hayooContexts.js $(JSONFILES)
i=1; \
for file in $(JSONDIR)/*.js; do \
echo -n "\n$$i - $$file"; \
curl -X POST -d @"$$file" $(SERVER)/eval; \
i=$$(($$i+1)); \
done
packed: hayooContexts.js
./makeJs.py --concat $(PACK_FILE_SIZE) packedFiles $(JSONFILES)
clean-packed:
rm -rf packedFiles
insert-packed:
i=1; \
for file in packedFiles/*.js; do \
echo -n "\n$$i - $$(date) - $$file "; \
curl -X POST -d @"$$file" $(SERVER)/eval; \
i=$$(($$i+1)); \
done
## insert complete hayoo index and save index
JHOST = $(SERVER)
JSONFILES = $(shell find json -name '*.js.bz2' -print | sort)
insert-json:
i=1; \
for file in $(JSONFILES); do \
echo -n "\n$$i - $$(date) - $$file "; \
bzcat $$file > xxx.js ; \
curl -X POST -d @"xxx.js" $(JHOST)/eval; \
rm -f xxx.js ; \
i=$$(($$i+1)); \
done ; \
curl $(JHOST)/binary/save/hayoo-ix.$$(date +%FT%T)