-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
60 lines (45 loc) · 2.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
53
54
55
56
57
58
59
60
TEST_ENV ?= LOCAL
ifeq ($(TEST_ENV), LOCAL)
COMPOSE_FILE = docker-compose.yml
else
COMPOSE_FILE = docker-compose.ci.yml
endif
deploy: build-local install-front build-front
python3 -m gunicorn --bind 0.0.0.0:8000 main:app
build: # Build Main App
docker build -t nlp-web:latest .
build-test: # Build Main App
docker build -t nlp-web:debug . --build-arg debug=1
build-local:
pip3 install -r requirements.txt
clean: # Tear down Main App
docker compose -f $(COMPOSE_FILE) -f docker-compose.test.yml down -v --remove-orphan
rm -rf testtest
up: # Start Main App
docker compose -f $(COMPOSE_FILE) up -d
install-front: # Install dependencies for front-end
# TODO: fix mui imports :/
cd static && npm install --legacy-peer-deps
build-front: # Build jsx into js
# cd src && ./node_modules/browserify/bin/cmd.js app/static/jsx/*.js --standalone nlp > app/static/js/bundle.js
mkdir -p static/src/js
cd static && ./node_modules/gulp/bin/gulp.js
docker run --rm -u $(id -u):$(id -g) -v ./mermaid:/data minlag/mermaid-cli -i financial_concepts.mmd -o financial_concepts.svg
docker run --rm -u $(id -u):$(id -g) -v ./mermaid:/data minlag/mermaid-cli -i financial_lifestyle.mmd -o financial_lifestyle.svg
build-mermaid:
docker run --rm -u $(id -u):$(id -g) -v ./mermaid:/data minlag/mermaid-cli -i financial_concepts.mmd -o financial_concepts.svg
docker run --rm -u $(id -u):$(id -g) -v ./mermaid:/data minlag/mermaid-cli -i financial_lifestyle.mmd -o financial_lifestyle.svg
build-static: # Convert python structures to javascript
./static.sh
test-front: # Test frontend UI
docker compose -f $(COMPOSE_FILE) -f docker-compose.test.yml up --abort-on-container-exit cypress
lint: # Lint python code
docker run --rm -v "$(shell pwd)":/app nlp-web:debug bash -c "cd /app/src/ && flake8 . --count --show-source --statistics"
test: # Test Flask Backend
docker compose -f $(COMPOSE_FILE) -f docker-compose.test.yml run --rm nlp \
bash -c "coverage run -m pytest --disable-pytest-warnings && \
coverage report --omit=\"src/tests/*\",\"app/auth/*\""
test-cov: # Test Flask Backend
docker compose -f $(COMPOSE_FILE) -f docker-compose.test.yml run --rm -v $(shell pwd):/app nlp \
bash -c "coverage run -m pytest --disable-pytest-warnings && \
coverage xml --omit=\"src/tests/*\",\"app/auth/*\""