This commit is contained in:
William Durand 2019-08-29 15:34:26 +02:00 коммит произвёл GitHub
Родитель 89bedc7c78
Коммит 464abd0d2c
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 30 добавлений и 48 удалений

Просмотреть файл

@ -10,10 +10,9 @@ include $(SUB_MAKEFILE)
help:
@echo "Please use 'make <target>' where <target> is one of the following commands."
@echo "Please use 'make <target>' where <target> is one of the following commands.\n"
@$(MAKE) help_submake --no-print-directory
@echo "Check the Makefile to know exactly what each target is doing."
@echo "\nCheck the Makefile to know exactly what each target is doing."
# You probably want to put new commands in Makefile-docker rather than here -
# unless they operate on multiple containers or are host-os specific, then

Просмотреть файл

@ -61,29 +61,8 @@ jquery-ui/ui/widgets/sortable.js
help_redirect:
@$(MAKE) help --no-print-directory
.PHONY: help_submake
help_submake:
@echo " initialize to init the dependencies, the database, and assets"
@echo " update to update the dependencies, the database, and assets"
@echo " initialize_db to create a new database"
@echo " populate_data to populate a new database"
@echo " reindex to reindex everything in elasticsearch, for AMO"
@echo " update_deps to update the python and node dependencies"
@echo " update_db to run the database migrations"
@echo " docs to build the documentation"
@echo " lint-codestyle to lint the code"
@echo " debug to connect for debugging"
@echo " djshell to connect to django shell"
@echo " dbshell to connect to a database shell"
@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 " tdd to run the entire test suite, but stop on the first error"
.PHONY: initialize_db
initialize_db:
initialize_db: ## create a new database
rm -rf ./user-media/* ./tmp/*
$(PYTHON_COMMAND) manage.py create_db --force
$(PYTHON_COMMAND) manage.py migrate --noinput --run-syncdb
@ -94,7 +73,7 @@ initialize_db:
$(PYTHON_COMMAND) manage.py loaddata zadmin/users
.PHONY: populate_data
populate_data:
populate_data: ## populate a new database
# reindex --wipe will force the ES mapping to be re-installed. Useful to
# make sure the mapping is correct before adding a bunch of add-ons.
$(PYTHON_COMMAND) manage.py reindex --wipe --force --noinput
@ -146,10 +125,10 @@ copy_node_js:
for dest in $(NODE_LIBS_JQUERY_UI) ; do cp $(NODE_MODULES)$$dest $(STATIC_JQUERY_UI) ; done
.PHONY: update_deps
update_deps: cleanup_python_build_dir install_python_dev_dependencies install_node_dependencies
update_deps: cleanup_python_build_dir install_python_dev_dependencies install_node_dependencies ## update the python and node dependencies
.PHONY: update_db
update_db:
update_db: ## run the database migrations
./schematic src/olympia/migrations
.PHONY: update_assets
@ -160,10 +139,10 @@ update_assets:
$(PYTHON_COMMAND) manage.py generate_jsi18n_files
.PHONY: update
update: update_deps update_db update_assets
update: update_deps update_db update_assets ## update the dependencies, the database, and assets
.PHONY: reindex
reindex:
reindex: ## reindex everything in elasticsearch, for AMO
$(PYTHON_COMMAND) manage.py reindex $(ARGS)
.PHONY: setup-ui-tests
@ -211,52 +190,57 @@ setup-codestyle:
$(PIP_COMMAND) install --progress-bar=off --no-deps --exists-action=w -r requirements/codestyle.txt
.PHONY: lint-codestyle
lint-codestyle:
lint-codestyle: ## lint the code
flake8 src/ services/ tests/
.PHONY: docs
docs:
docs: ## build the documentation
$(MAKE) -C docs html SPHINXOPTS='-nW'
.PHONY: debug
debug:
debug: ## connect for debugging
supervisorctl fg olympia
.PHONY: djshell
djshell:
djshell: ## connect to django shell
$(PYTHON_COMMAND) ./manage.py shell_plus
.PHONY: dbshell
dbshell:
dbshell: ## connect to a database shell
$(PYTHON_COMMAND) ./manage.py dbshell
.PHONY: initialize
initialize: update_deps initialize_db update_assets populate_data
initialize: update_deps initialize_db update_assets populate_data ## init the dependencies, the database, and assets
.PHONY: reload-uwsgi
reload-uwsgi:
reload-uwsgi: ## force django code reload
uwsgi --reload /code/docker/artifacts/addons-server-uwsgi-master.pid
.PHONY: test
test:
test: ## run the entire test suite
pytest $(APP) $(ARGS)
.PHONY: test_es
test_es:
test_es: ## run the ES tests
pytest -m es_tests $(APP) $(ARGS)
.PHONY: test_no_es
test_no_es:
test_no_es: ## run all but the ES tests
pytest -m "not es_tests" $(APP) $(ARGS)
.PHONY: test_force_db
test_force_db:
test_force_db: ## run the entire test suite with a new database
pytest --create-db $(APP) $(ARGS)
.PHONY: tdd
tdd:
tdd: ## run the entire test suite, but stop on the first error
pytest -x --pdb $(ARGS) $(APP)
.PHONY: test_failed
test_failed:
test_failed: ## rerun the failed tests from the previous run
pytest --lf $(ARGS) $(APP)
.PHONY: help_submake
help_submake:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

Просмотреть файл

@ -5,20 +5,19 @@ help_redirect:
.PHONY: help_submake
help_submake:
@echo "Host only commands:"
@echo " shell to connect to a running addons-server docker shell"
@echo " update_docker to update all the docker images"
@echo "All other commands will be passed through to the docker 'web' container make:"
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' Makefile-os | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
@echo "\nAll other commands will be passed through to the docker 'web' container make:"
@make -f Makefile-docker help_submake
.PHONY: update_docker
update_docker:
update_docker: ## update all the docker images
docker-compose exec worker make update_deps
docker-compose exec web make update
docker-compose restart web
docker-compose restart worker
.PHONY: shell
shell:
shell: ## connect to a running addons-server docker shell
docker-compose exec web bash
%: ## This directs any other recipe (command) to the web container's make.