2017-06-15 11:41:40 +03:00
|
|
|
APP=src/olympia/
|
|
|
|
|
2019-02-13 18:21:05 +03:00
|
|
|
.PHONY: help_redirect
|
2017-06-15 11:41:40 +03:00
|
|
|
help_redirect:
|
|
|
|
@$(MAKE) help --no-print-directory
|
|
|
|
|
2019-02-13 18:21:05 +03:00
|
|
|
.PHONY: help_submake
|
2017-06-15 11:41:40 +03:00
|
|
|
help_submake:
|
|
|
|
@echo "Commands that are designed to be run in the host:"
|
|
|
|
@echo " debug to connect to a running addons-server docker for debugging"
|
|
|
|
@echo " djshell to connect to a running addons-server docker django shell"
|
|
|
|
@echo " dbshell to connect to a running addons-server docker database shell"
|
|
|
|
@echo " make to connect to a running addons-server docker and run make ARGS"
|
|
|
|
@echo " shell to connect to a running addons-server docker shell"
|
|
|
|
@echo " tdd to run the entire test suite, but stop on the first error"
|
|
|
|
@echo " test to run the entire test suite"
|
|
|
|
@echo " test_es to run the ES tests"
|
|
|
|
@echo " test_failed to rerun the failed tests from the previous run"
|
|
|
|
@echo " test_force_db to run the entire test suite with a new database"
|
|
|
|
@echo " test_no_es to run all but the ES tests"
|
|
|
|
@echo " initialize_docker to initialize a docker image"
|
|
|
|
@echo " update_docker to update a docker image"
|
|
|
|
|
2019-02-13 18:21:05 +03:00
|
|
|
.PHONY: test
|
2017-06-15 11:41:40 +03:00
|
|
|
test:
|
2018-02-02 14:47:50 +03:00
|
|
|
docker-compose exec web pytest $(APP) $(ARGS)
|
2017-06-15 11:41:40 +03:00
|
|
|
|
2019-02-13 18:21:05 +03:00
|
|
|
.PHONY: test_es
|
2017-06-15 11:41:40 +03:00
|
|
|
test_es:
|
2018-02-02 14:47:50 +03:00
|
|
|
docker-compose exec web pytest -m es_tests $(APP) $(ARGS)
|
2017-06-15 11:41:40 +03:00
|
|
|
|
2019-02-13 18:21:05 +03:00
|
|
|
.PHONY: test_no_es
|
2017-06-15 11:41:40 +03:00
|
|
|
test_no_es:
|
2018-02-02 14:47:50 +03:00
|
|
|
docker-compose exec web pytest -m "not es_tests" $(APP) $(ARGS)
|
2017-06-15 11:41:40 +03:00
|
|
|
|
2019-02-13 18:21:05 +03:00
|
|
|
.PHONY: test_force_db
|
2017-06-15 11:41:40 +03:00
|
|
|
test_force_db:
|
2018-02-02 14:47:50 +03:00
|
|
|
docker-compose exec web pytest --create-db $(APP) $(ARGS)
|
2017-06-15 11:41:40 +03:00
|
|
|
|
2019-02-13 18:21:05 +03:00
|
|
|
.PHONY: tdd
|
2017-06-15 11:41:40 +03:00
|
|
|
tdd:
|
2018-02-02 14:47:50 +03:00
|
|
|
docker-compose exec web pytest -x --pdb $(ARGS) $(APP)
|
2017-06-15 11:41:40 +03:00
|
|
|
|
2019-02-13 18:21:05 +03:00
|
|
|
.PHONY: test_failed
|
2017-06-15 11:41:40 +03:00
|
|
|
test_failed:
|
2018-02-02 14:47:50 +03:00
|
|
|
docker-compose exec web pytest --lf $(ARGS) $(APP)
|
2017-06-15 11:41:40 +03:00
|
|
|
|
2019-02-13 18:21:05 +03:00
|
|
|
.PHONY: update_docker
|
2017-06-15 11:41:40 +03:00
|
|
|
update_docker:
|
|
|
|
docker-compose exec worker make update_deps
|
|
|
|
docker-compose exec web make update
|
2018-02-19 19:07:34 +03:00
|
|
|
docker-compose restart web
|
|
|
|
docker-compose restart worker
|
2017-06-15 11:41:40 +03:00
|
|
|
|
2019-02-13 18:21:05 +03:00
|
|
|
.PHONY: initialize_docker
|
2017-06-15 11:41:40 +03:00
|
|
|
initialize_docker:
|
|
|
|
docker-compose exec web make initialize
|
|
|
|
|
2019-02-13 18:21:05 +03:00
|
|
|
.PHONY: debug
|
2017-06-15 11:41:40 +03:00
|
|
|
debug:
|
|
|
|
docker-compose exec web supervisorctl fg olympia
|
|
|
|
|
2019-02-13 18:21:05 +03:00
|
|
|
.PHONY: shell
|
2017-06-15 11:41:40 +03:00
|
|
|
shell:
|
|
|
|
docker-compose exec web bash
|
|
|
|
|
2019-02-13 18:21:05 +03:00
|
|
|
.PHONY: djshell
|
2017-06-15 11:41:40 +03:00
|
|
|
djshell:
|
2017-11-09 20:18:52 +03:00
|
|
|
docker-compose exec web ./manage.py shell_plus
|
2017-06-15 11:41:40 +03:00
|
|
|
|
2019-02-13 18:21:05 +03:00
|
|
|
.PHONY: dbshell
|
2017-06-15 11:41:40 +03:00
|
|
|
dbshell:
|
|
|
|
docker-compose exec web ./manage.py dbshell
|
|
|
|
|
|
|
|
# Run a make command in the container
|
2019-02-13 18:21:05 +03:00
|
|
|
.PHONY: make
|
2017-06-15 11:41:40 +03:00
|
|
|
make:
|
|
|
|
docker-compose exec web make $(ARGS)
|