2014-11-19 19:36:40 +03:00
|
|
|
.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
|
2014-10-13 17:42:34 +04:00
|
|
|
NUM_ADDONS=10
|
|
|
|
NUM_THEMES=$(NUM_ADDONS)
|
2013-11-20 15:00:42 +04:00
|
|
|
|
2014-10-28 17:37:38 +03:00
|
|
|
UNAME_S := $(shell uname -s)
|
|
|
|
|
2015-03-17 17:00:05 +03:00
|
|
|
# If you're using docker and docker-compose, you can use this Makefile to run
|
|
|
|
# commands in your docker images by setting the DOCKER_PREFIX environment variable
|
|
|
|
# to: DOCKER_PREFIX="docker-compose run --rm web"
|
2014-10-01 15:44:44 +04:00
|
|
|
|
2013-11-20 15:00:42 +04:00
|
|
|
help:
|
2014-09-29 18:04:49 +04:00
|
|
|
@echo "Please use 'make <target>' where <target> is one of"
|
2014-08-07 15:11:48 +04:00
|
|
|
@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"
|
2014-09-18 21:55:51 +04:00
|
|
|
@echo " initialize_db to create a new database"
|
2014-09-29 18:04:49 +04:00
|
|
|
@echo " populate_data to populate a new database"
|
2014-08-08 16:08:46 +04:00
|
|
|
@echo " update_code to update the git repository"
|
2014-08-07 15:11:48 +04:00
|
|
|
@echo " update_deps to update the python and npm dependencies"
|
|
|
|
@echo " update_db to run the database migrations"
|
2014-09-18 21:55:51 +04:00
|
|
|
@echo " full_init to init the code, the dependencies and the database"
|
2014-08-07 15:11:48 +04:00
|
|
|
@echo " full_update to update the code, the dependencies and the database"
|
|
|
|
@echo " reindex to reindex everything in elasticsearch, for AMO"
|
2014-10-21 20:01:56 +04:00
|
|
|
@echo " flake8 to run the flake8 linter"
|
2014-08-07 15:11:48 +04:00
|
|
|
@echo "Check the Makefile to know exactly what each target is doing. If you see a "
|
2013-11-20 15:00:42 +04:00
|
|
|
|
|
|
|
docs:
|
2015-03-17 17:00:05 +03:00
|
|
|
$(DOCKER_PREFIX) $(MAKE) -C docs html
|
2013-11-20 15:00:42 +04:00
|
|
|
|
|
|
|
test:
|
2015-03-17 17:00:05 +03:00
|
|
|
$(DOCKER_PREFIX) py.test $(ARGS)
|
2014-11-19 19:36:40 +03:00
|
|
|
|
|
|
|
test_es:
|
2015-03-17 17:00:05 +03:00
|
|
|
$(DOCKER_PREFIX) py.test -m es_tests $(ARGS)
|
2014-11-19 19:36:40 +03:00
|
|
|
|
|
|
|
test_no_es:
|
2015-03-17 17:00:05 +03:00
|
|
|
$(DOCKER_PREFIX) py.test -m "not es_tests" $(ARGS)
|
2013-11-20 15:00:42 +04:00
|
|
|
|
|
|
|
test_force_db:
|
2015-03-17 17:00:05 +03:00
|
|
|
$(DOCKER_PREFIX) py.test --create-db $(ARGS)
|
2013-11-20 15:00:42 +04:00
|
|
|
|
|
|
|
tdd:
|
2015-03-17 17:00:05 +03:00
|
|
|
$(DOCKER_PREFIX) py.test -x --pdb $(ARGS)
|
2013-11-20 15:00:42 +04:00
|
|
|
|
|
|
|
test_failed:
|
2015-03-17 17:00:05 +03:00
|
|
|
$(DOCKER_PREFIX) py.test --lf $(ARGS)
|
2013-11-20 15:00:42 +04:00
|
|
|
|
2014-09-18 21:55:51 +04:00
|
|
|
initialize_db:
|
2015-03-17 17:00:05 +03:00
|
|
|
$(DOCKER_PREFIX) python manage.py reset_db
|
|
|
|
$(DOCKER_PREFIX) python manage.py syncdb --noinput
|
|
|
|
$(DOCKER_PREFIX) python manage.py loaddata initial.json
|
|
|
|
$(DOCKER_PREFIX) python manage.py import_prod_versions
|
|
|
|
$(DOCKER_PREFIX) schematic --fake migrations/
|
|
|
|
$(DOCKER_PREFIX) python manage.py createsuperuser
|
|
|
|
$(DOCKER_PREFIX) python manage.py loaddata zadmin/users
|
2014-09-18 21:55:51 +04:00
|
|
|
|
2014-09-29 18:04:49 +04:00
|
|
|
populate_data:
|
2015-03-17 17:00:05 +03:00
|
|
|
$(DOCKER_PREFIX) python manage.py generate_addons --app firefox $(NUM_ADDONS)
|
|
|
|
$(DOCKER_PREFIX) python manage.py generate_addons --app thunderbird $(NUM_ADDONS)
|
|
|
|
$(DOCKER_PREFIX) python manage.py generate_addons --app android $(NUM_ADDONS)
|
|
|
|
$(DOCKER_PREFIX) python manage.py generate_addons --app seamonkey $(NUM_ADDONS)
|
|
|
|
$(DOCKER_PREFIX) python manage.py generate_themes $(NUM_THEMES)
|
|
|
|
$(DOCKER_PREFIX) python manage.py reindex --wipe --force
|
2014-09-29 18:04:49 +04:00
|
|
|
|
2014-04-22 13:17:21 +04:00
|
|
|
update_code:
|
2015-03-17 17:00:05 +03:00
|
|
|
$(DOCKER_PREFIX) git checkout master && git pull
|
2014-04-22 13:17:21 +04:00
|
|
|
|
|
|
|
update_deps:
|
2015-07-28 10:51:54 +03:00
|
|
|
$(DOCKER_PREFIX) pip install --no-deps --exists-action=w -r requirements/dev.txt --find-links https://pyrepo.addons.mozilla.org/wheelhouse/ --find-links https://pyrepo.addons.mozilla.org/ --no-index
|
2015-03-17 17:00:05 +03:00
|
|
|
$(DOCKER_PREFIX) npm install
|
2013-12-12 01:15:12 +04:00
|
|
|
|
2014-04-22 13:17:21 +04:00
|
|
|
update_db:
|
2015-03-17 17:00:05 +03:00
|
|
|
$(DOCKER_PREFIX) schematic migrations
|
2013-11-20 15:00:42 +04:00
|
|
|
|
2014-06-04 13:08:02 +04:00
|
|
|
update_assets:
|
2015-03-17 17:00:05 +03:00
|
|
|
$(DOCKER_PREFIX) python manage.py compress_assets
|
|
|
|
$(DOCKER_PREFIX) python manage.py collectstatic --noinput
|
2014-06-04 13:08:02 +04:00
|
|
|
|
2014-09-29 18:04:49 +04:00
|
|
|
full_init: update_deps initialize_db populate_data update_assets
|
2014-04-22 13:17:21 +04:00
|
|
|
|
2014-09-18 21:55:51 +04:00
|
|
|
full_update: update_code update_deps update_db update_assets
|
2013-11-20 15:00:42 +04:00
|
|
|
|
|
|
|
reindex:
|
2015-03-17 17:00:05 +03:00
|
|
|
$(DOCKER_PREFIX) python manage.py reindex $(ARGS)
|
2014-10-21 20:01:56 +04:00
|
|
|
|
|
|
|
flake8:
|
2015-03-17 17:00:05 +03:00
|
|
|
$(DOCKER_PREFIX) flake8 --ignore=E265,E266 --exclude=services,wsgi,docs,node_modules,build*.py .
|