-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
111 lines (83 loc) · 3.89 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
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
100
101
102
103
104
105
106
107
108
109
110
111
.DEFAULT_GOAL := test
.PHONY: clean compile_translations dummy_translations extract_translations fake_translations help html_coverage \
migrate pull_translations push_translations quality pii_check requirements test update_translations validate
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " clean delete generated byte code and coverage reports"
@echo " compile_translations compile translation files, outputting .po files for each supported language"
@echo " dummy_translations generate dummy translation (.po) files"
@echo " extract_translations extract strings to be translated, outputting .mo files"
@echo " fake_translations generate and compile dummy translation files"
@echo " help display this help message"
@echo " html_coverage generate and view HTML coverage report"
@echo " migrate apply database migrations"
@echo " prod-requirements install requirements for production"
@echo " pull_translations pull translations from Transifex"
@echo " push_translations push source translation files (.po) from Transifex"
@echo " quality run Pycodestyle and Pylint"
@echo " pii_check check for PII annotations on all Django models"
@echo " requirements install requirements for local development"
@echo " test run tests and generate coverage report"
@echo " validate run tests and quality checks"
@echo " start-devstack run a local development copy of the server"
@echo " open-devstack open a shell on the server started by start-devstack"
@echo " pkg-devstack build the registrar image from the latest configuration and code"
@echo " detect_changed_source_translations check if translation files are up-to-date"
@echo " validate_translations install fake translations and check if translation files are up-to-date"
@echo ""
clean:
find . -name '*.pyc' -delete
coverage erase
rm -rf assets
rm -rf pii_report
requirements:
pip install -qr requirements/local.txt --exists-action w
prod-requirements:
pip install -qr requirements.txt --exists-action w
test: clean
coverage run ./manage.py test registrar --settings=registrar.settings.test
coverage report
quality:
pycodestyle registrar *.py
pylint --rcfile=pylintrc registrar *.py
pii_check:
DJANGO_SETTINGS_MODULE=registrar.settings.test \
code_annotations django_find_annotations --config_file .pii_annotations.yml --lint --report --coverage
validate: test quality pii_check
migrate:
python manage.py migrate
html_coverage:
coverage html && open htmlcov/index.html
extract_translations:
python manage.py makemessages -l en -v1 -d django
python manage.py makemessages -l en -v1 -d djangojs
dummy_translations:
cd registrar && i18n_tool dummy
compile_translations:
python manage.py compilemessages
fake_translations: extract_translations dummy_translations compile_translations
pull_translations:
tx pull -af --mode reviewed
push_translations:
tx push -s
pkg-devstack:
docker build -t registrar:latest -f docker/build/registrar/Dockerfile git://github.com/edx/configuration
detect_changed_source_translations:
cd registrar && i18n_tool changed
validate_translations: fake_translations detect_changed_source_translations
build:
docker-compose build
up:
docker-compose up -d
down:
docker-compose down
shell:
docker exec -it registrar-app /bin/bash
db_shell:
docker exec -it registrar-db mysql -uroot registrar
logs:
docker logs -f registrar-app
restart: ## Kill the Django development server. The watcher process will restart it.
docker exec -t registrar-app bash -c 'kill $$(ps aux | grep "manage.py runserver" | egrep -v "while|grep" | awk "{print \$$2}")'
provision_db:
docker exec -i registrar-db mysql -uroot mysql < provision.sql