-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
99 lines (74 loc) · 2.17 KB
/
Copy pathMakefile
File metadata and controls
99 lines (74 loc) · 2.17 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
.ONESHELL:
.DEFAULT_GOAL := run
PYTHON = ./.venv/bin/python3
PIP = ./.venv/bin/pip
.PHONY: help auth clean dbclean mongostart mongostop run setup swag test test-integration
help:
@echo "make help - display this help"
@echo "make auth - run auth api application"
@echo "make build - create and activate virtual environment"
@echo "make clean - remove all generated files"
@echo "make dbclean - clear the application database"
@echo "make mongostart - start local mongodb instance"
@echo "make mongostop - stop local mongodb instance"
@echo "make run - run the application"
@echo "make swag - open swagger documentation"
@echo "make setup - setup the application database"
@echo "make test - run tests and coverage report"
@echo "make test-integration - run integration tests in test environment"
@echo "make helptools - display help for tools"
auth:
$(PYTHON) ../tdse-accessForce-auth-stub/app.py
build: requirements.txt
python3 -m venv .venv
$(PIP) install -r requirements.txt
. ./.venv/bin/activate
clean:
@echo "Cleaning up..."
@find . -name "__pycache__" -type d -exec rm -rf {} +
@find . -name ".pytest_cache" -exec rm -rf {} +
@find . -name ".venv" -exec rm -rf {} +
dbclean:
@echo "Cleaning up database..."
cd ./scripts/; \
make dbclean
@echo "Database cleared."
mongostart:
@echo "Starting MongoDB..."
brew services start mongodb-community@6.0
mongostop:
@echo "Stopping MongoDB..."
brew services stop mongodb-community@6.0
run: build
$(PYTHON) app.py
setup:
@echo "Setting up application database..."
cd ./scripts/; \
make dbclean; \
make bids; \
make questions
@echo "Database setup complete."
swag:
open http://localhost:8080/api/docs/#/
test:
-coverage run -m pytest tests/unit -vv -s
@echo "TEST COVERAGE REPORT"
coverage report -m --omit="app.py,tests/*,dbconfig/*,custom_formatter.py,conftest.py"
test-integration:
pytest tests/integration -vv -s
.PHONY: helptools authplay branch check commit format lint
helptools:
make -f tools.mk help
authplay:
cd ./scripts/; \
make authplay
branch:
make -f tools.mk branch
check:
make -f tools.mk check
commit:
make -f tools.mk commit
format:
make -f tools.mk format
lint:
make -f tools.mk lint