forked from watchdogpolska/feder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
71 lines (48 loc) · 2.15 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
67
68
69
70
71
TEST?=feder
.PHONY: docs
clean:
docker-compose down
regenerate_frontend:
docker-compose up gulp
docker-compose run web python manage.py collectstatic --noinput
makemessages:
docker-compose run web python manage.py makemessages --ignore=htmlcov --all
gulp: regenerate_frontend
build:
docker-compose build web
start: wait_mysql wait_elasticsearch wait_tika
docker-compose up
test:
docker-compose run web coverage run manage.py test --keepdb --verbosity=2 ${TEST}
coverage_html:
docker-compose run web coverage html
coverage_send:
docker-compose run -e GITHUB_ACTIONS -e GITHUB_REF -e GITHUB_SHA -e GITHUB_HEAD_REF -e GITHUB_REPOSITORY -e GITHUB_RUN_ID -e GITHUB_TOKEN -e COVERALLS_REPO_TOKEN web coveralls
wait_web: wait_mysql wait_elasticsearch wait_tika
wait_mysql:
docker-compose up -d db
docker-compose run web bash -c 'wait-for-it -t 30 db:3306' || (docker-compose logs db; exit -1)
wait_elasticsearch:
docker-compose up -d elasticsearch
docker-compose run web bash -c 'wait-for-it -t 30 elasticsearch:9200' || (docker-compose logs elasticsearch; exit -1)
wait_tika:
docker-compose up -d tika
docker-compose run web bash -c 'wait-for-it -t 60 tika:9998' || (docker-compose logs tika; exit -1)
migrate:
docker-compose run web python manage.py migrate
lint: # lint currently staged files
pre-commit run
lint-all: # lint all files in repository
pre-commit run --all-files
check: wait_mysql
docker-compose run web python manage.py makemigrations --check
migrations: wait_mysql
docker-compose run web python manage.py makemigrations
settings:
docker-compose run web python manage.py diffsettings
docs:
docker-compose run web sphinx-build -b html -d docs/_build/doctrees docs docs/_build/html
importterc:
docker-compose run web sh -c 'curl http://cdn.files.jawne.info.pl/public_html/2017/12/03_05_43_05/TERC_Urzedowy_2017-12-03.xml --output /tmp/TERC.xml && python manage.py load_terc --input /tmp/TERC.xml'
createsuperuser: # polyfill for django <3. On django 3+ you can use the `DJANGO_SUPERUSER_PASSWORD` env variable.
docker-compose run web python manage.py createsuperuserwithpassword --username root --email [email protected] --password root --noinput