-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
66 lines (46 loc) · 1.46 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
.PHONY: default conda-env deploy
.PHONY: backend frontend frontend-packages build backend-tests
.PHONY: test-ci test-frontend-ci test-backend-ci
default:
@echo "available commands:"
@echo "backend"
@echo " -- Starts the backend server locally"
@echo "backend-tests"
@echo " -- Starts the backend unit tests"
@echo "frontend"
@echo " -- Starts frontend in interactive mode"
@echo "build"
@echo " -- Builds the project"
@echo "conda-env"
@echo " -- Rebuilds conda environment 'SmartForms'"
backend:
(cd backend/sources && python main.py)
backend-train:
(cd backend/sources && python main.py --train=True)
backend-tests:
(cd backend/sources/tests && python -m unittest)
frontend-packages:
(cd frontend && yarn)
frontend: frontend-packages
(cd frontend && yarn dev)
build: frontend-packages
test-backend-ci:
@echo "TODO: No backend tests to run :/"
test-frontend-ci:
(cd frontend && CI=true yarn test --watchAll=false)
test-ci:
$(MAKE) test-backend-ci
$(MAKE) test-frontend-ci
# Delete the line 'tensorflow' from pip requirements for arm
# Run the deploy script
# Restore the requirements.txt file
deploy:
cp ./backend/requirements.txt ./backend/requirements.txt.bak
sed -i '/tensorflow/d' ./backend/requirements.txt
chmod +x deploy_script.sh
./deploy_script.sh
rm ./backend/requirements.txt
mv ./backend/requirements.txt.bak ./backend/requirements.txt
@echo " ---- Deploy Finished ---- "
conda-env:
conda env update -f conda_environment.yaml