-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile
More file actions
71 lines (54 loc) · 2.28 KB
/
Makefile
File metadata and controls
71 lines (54 loc) · 2.28 KB
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
clinviro-frontend/build: $(shell find clinviro-frontend -not -path "clinviro-frontend/build/*" -a -not -path "clinviro-frontend/node_modules/*" -a -type f)
@cd clinviro-frontend && npm install && npm run build
force-build:
@docker build . --force-rm --no-cache -t hivdb/clinviro:latest
build:
@docker build . -t hivdb/clinviro:latest
# following are development commands, do not use them in production
# use docker image instead!
console:
@docker run --rm -it hivdb/clinviro:latest shell
devdb:
$(eval volumes = $(shell docker inspect -f '{{ range .Mounts }}{{ .Name }}{{ end }}' clinviro-devdb))
@mkdir -p initdb.d
@docker rm -f clinviro-devdb 2>/dev/null || true
@docker volume rm $(volumes) 2>/dev/null || true
@docker run \
-d --name=clinviro-devdb \
--publish 127.0.0.1:5435:5432 \
--volume=$(shell pwd)/initdb.d:/docker-entrypoint-initdb.d \
postgres:9.6
deves:
@docker rm -f clinviro-deves 2>/dev/null || true
@docker run \
-d --name=clinviro-deves \
--publish 127.0.0.1:9200:9200 \
--publish 127.0.0.1:9300:9300 \
elasticsearch:5.4-alpine
sync-deves:
@FLASK_APP=clinviro/__init__.py flask patients create_index --autoremove
sync-blastdb:
@FLASK_APP=clinviro/__init__.py flask makeblastdb
sync-schema:
@FLASK_APP=clinviro/__init__.py flask export_relay_schema clinviro-frontend/schema.json
@rm -r clinviro-frontend/node_modules/.cache 2>/dev/null || true
psql-devdb:
@psql -h localhost -p 5435 -U postgres
dumpdb:
@mkdir -p local/
@docker exec clinviro-devdb pg_dump -h localhost -U postgres -t "tbl_*" -t "alembic_*" -c postgres > local/clinviro_dump.sql
@echo '`local/clinviro_dump.sql` created.'
dumpdb-without-patients:
@mkdir -p local/
@docker exec clinviro-devdb pg_dump -h localhost -U postgres -a -t tbl_clinics -t tbl_physicians > local/clinviro_dump-without_patients.sql
@echo '`local/clinviro_dump-without_patients.sql` created.'
blastdb:
@FLASK_APP=clinviro/__init__.py flask makeblastdb
shell:
@FLASK_APP=clinviro/__init__.py flask shell
run-frontend: sync-schema
@cd clinviro-frontend; npm start
_run:
@gunicorn -w 4 -b 127.0.0.1:5000 --worker-class aiohttp.worker.GunicornWebWorker clinviro:aioapp
run: sync-blastdb sync-schema _run
.PHONY: force-build build console devdb psql-devdb dumpdb psql-devdb-migrate dumpdb-without-patients blastdb shell run _run