-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathMakefile
65 lines (48 loc) · 1.28 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
.EXPORT_ALL_VARIABLES:
BETTER_EXCEPTIONS=1
DJANGO_SETTINGS_MODULE?=backend.settings.lint
migrate:
python src/manage.py migrate
migrations:
python src/manage.py makemigrations
test: migrate
pytest src || \
if [ $$? = 5 ]; \
then exit 0; \
else exit $$?; \
fi
coverage: migrate
pytest --cov=. --cov-report=xml src && \
coverage html
which xdg-open && \
xdg-open htmlcov/index.html || true
format:
isort src && \
black src
lint:
flake8 && \
isort --check-only src
dev-server:
docker-compose build && \
docker-compose up -d
dev-test: dev-server
docker-compose exec backend pytest --cov=src src
fake-data:
python -m scripts.fake generate $(ARGS)
fake-bulk-data:
python -m scripts.fake generate --teams 10000 --users 2 --categories 10 --challenges 100 --solves 1000000
clean-db:
python scripts/clean_db.py
clean-test:
rm -rf /tmp/ractf-linting.cache /tmp/ractf-linting.db
clean-dev-server:
docker-compose rm -sfv
docker volume rm -f core_postgres
dev-logs:
docker-compose logs -f backend
dev-sql:
docker-compose exec database psql -U postgres postgres
dev-fake-bulk-data:
docker-compose exec backend python -m scripts.fake generate --teams 10000 --users 2 --categories 10 --challenges 100 --solves 10000
dev-shell:
docker-compose exec backend ./src/manage.py shell