-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (39 loc) · 1.26 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
.PHONY: all test_search setup_docker setup_elasticsearch prerequisites
all: prerequisites test_search
test_search_google: test-vectors-google.txt
cp test-vectors-google.txt test-vectors.txt
ruby test_search.rb
test_search_iso: test-vectors-iso.txt
cp test-vectors-iso.txt test-vectors.txt; \
ruby test_search.rb
test-vectors-iso.txt:
node prepare-test-vectors.js tests/dataset-iso.csv; \
mv test-vectors.txt $@
test-vectors-google.txt:
node prepare-test-vectors.js tests/dataset-google.csv; \
mv test-vectors.txt $@
setup_docker:
docker network create elastic-network
docker run -d --name elasticsearch --net elastic-network \
-p 9200:9200 -p 9300:9300 \
-e "discovery.type=single-node" \
-e "xpack.security.enabled=false" \
elasticsearch:8.4.2
kill_docker:
CONTAINER=$$(docker ps -f name=elasticsearch -q -a); \
[ -z "$$CONTAINER" ] || docker rm -f $$CONTAINER; \
docker network prune -f
prerequisites: | update
bundle install
yarn
cd breviter && yarn
setup_elasticsearch: db.json | prerequisites
ruby prepare_elasticsearch.rb
db.json: | prerequisites
cd breviter && yarn compute
cp breviter/public/db.json db.json
clean: kill_docker
rm -f test-vectors.txt
setup: setup_docker setup_elasticsearch
update:
git submodule update --init --recursive