-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
58 lines (44 loc) · 1.12 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
.PHONY: clean
clean:
rm -f api/database/data.db
.PHONY: backfill-submissions
backfill-submissions:
PYTHONPATH=$(CURDIR) poetry run python api/scripts/reload_submissions.py
.PHONY: data
data:
PYTHONPATH=$(CURDIR) poetry run python api/scripts/load_data.py
.PHONY: data-%
data-%:
PYTHONPATH=$(CURDIR) poetry run python api/scripts/load_data.py $*
.PHONY: download-data
download-data:
wget https://$(S3_BUCKET).s3.amazonaws.com/data.dump
.PHONY: deploy-data
deploy-data: data.dump
aws s3 cp $< s3://$(S3_BUCKET)/
.PHONY: restore
restore: data.dump
pg_restore -d $(DATABASE_URL) -F c $<
data.dump:
pg_dump $(DATABASE_URL) -F c -f $@
.PHONY: start
start:
$(MAKE) -j 2 start-py start-js
.PHONY: start-py
start-py:
poetry run flask --debug run --host=0.0.0.0
.PHONY: start-js
start-js:
VITE_PUBLIC_URL="" VITE_BASE_URL=http://localhost:5000 npm start
.PHONY: install
install: install-js install-py
.PHONY: install-js
install-js:
npm install
.PHONY: install-py
install-py:
poetry self add poetry-dotenv-plugin
poetry install
.PHONY: render-doc
render-doc:
PYTHONPATH=$(CURDIR) poetry run python api/scripts/render_doc.py