forked from mozilla/addons-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
89 lines (69 loc) · 3.34 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
.PHONY: help docs test test_es test_no_es test_force_db tdd test_failed initialize_db populate_data update_code update_deps update_db update_assets full_init full_update reindex flake8
NUM_ADDONS=10
NUM_THEMES=$(NUM_ADDONS)
UNAME_S := $(shell uname -s)
# If you're using docker and fig, you can use this Makefile to run commands in
# your docker images by setting the FIG_PREFIX environment variable to:
# FIG_PREFIX="fig run --rm web"
help:
@echo "Please use 'make <target>' where <target> is one of"
@echo " docs to builds the docs for Zamboni"
@echo " test to run all the test suite"
@echo " test_force_db to run all the test suite with a new database"
@echo " tdd to run all the test suite, but stop on the first error"
@echo " test_failed to rerun the failed tests from the previous run"
@echo " initialize_db to create a new database"
@echo " populate_data to populate a new database"
@echo " update_code to update the git repository"
@echo " update_deps to update the python and npm dependencies"
@echo " update_db to run the database migrations"
@echo " full_init to init the code, the dependencies and the database"
@echo " full_update to update the code, the dependencies and the database"
@echo " reindex to reindex everything in elasticsearch, for AMO"
@echo " flake8 to run the flake8 linter"
@echo "Check the Makefile to know exactly what each target is doing. If you see a "
docs:
$(FIG_PREFIX) $(MAKE) -C docs html
test:
$(FIG_PREFIX) py.test $(ARGS)
test_es:
$(FIG_PREFIX) py.test -m es_tests $(ARGS)
test_no_es:
$(FIG_PREFIX) py.test -m "not es_tests" $(ARGS)
test_force_db:
$(FIG_PREFIX) py.test --create-db $(ARGS)
tdd:
$(FIG_PREFIX) py.test -x --pdb $(ARGS)
test_failed:
$(FIG_PREFIX) py.test --lf $(ARGS)
initialize_db:
$(FIG_PREFIX) python manage.py reset_db
$(FIG_PREFIX) python manage.py syncdb --noinput
$(FIG_PREFIX) python manage.py loaddata initial.json
$(FIG_PREFIX) python manage.py import_prod_versions
$(FIG_PREFIX) schematic --fake migrations/
$(FIG_PREFIX) python manage.py createsuperuser
$(FIG_PREFIX) python manage.py loaddata zadmin/users
populate_data:
$(FIG_PREFIX) python manage.py generate_addons --app firefox $(NUM_ADDONS)
$(FIG_PREFIX) python manage.py generate_addons --app thunderbird $(NUM_ADDONS)
$(FIG_PREFIX) python manage.py generate_addons --app android $(NUM_ADDONS)
$(FIG_PREFIX) python manage.py generate_addons --app seamonkey $(NUM_ADDONS)
$(FIG_PREFIX) python manage.py generate_themes $(NUM_THEMES)
$(FIG_PREFIX) python manage.py reindex --wipe --force
update_code:
$(FIG_PREFIX) git checkout master && git pull
update_deps:
$(FIG_PREFIX) pip install --no-deps --exists-action=w --download-cache=/tmp/pip-cache -r requirements/dev.txt --find-links https://pyrepo.addons.mozilla.org/wheelhouse/
$(FIG_PREFIX) npm install
update_db:
$(FIG_PREFIX) schematic migrations
update_assets:
$(FIG_PREFIX) python manage.py compress_assets
$(FIG_PREFIX) python manage.py collectstatic --noinput
full_init: update_deps initialize_db populate_data update_assets
full_update: update_code update_deps update_db update_assets
reindex:
$(FIG_PREFIX) python manage.py reindex $(ARGS)
flake8:
$(FIG_PREFIX) flake8 --ignore=E265,E266 --exclude=services,wsgi,docs,node_modules,build*.py .