Changeset View
Changeset View
Standalone View
Standalone View
Makefile.local
Show All 24 Lines | |||||
.PHONY: run-migrations | .PHONY: run-migrations | ||||
run-migrations: | run-migrations: | ||||
python3 swh/web/manage.py migrate --settings=swh.web.settings.development -v0 2>/dev/null | python3 swh/web/manage.py migrate --settings=swh.web.settings.development -v0 2>/dev/null | ||||
.PHONY: run-migrations-prod | .PHONY: run-migrations-prod | ||||
run-migrations-prod: | run-migrations-prod: | ||||
django-admin migrate --settings=swh.web.settings.production -v0 2>/dev/null | django-admin migrate --settings=swh.web.settings.production -v0 2>/dev/null | ||||
add-test-users: | |||||
cat swh/web/tests/create_test_admin.py | django-admin shell --settings=swh.web.settings.tests | |||||
cat swh/web/tests/create_test_users.py | django-admin shell --settings=swh.web.settings.tests | |||||
.PHONY: run-migrations-test | .PHONY: run-migrations-test | ||||
run-migrations-test: | run-migrations-test: | ||||
rm -f swh/web/settings/testdb.sqlite3 | rm -f swh/web/settings/testdb.sqlite3 | ||||
django-admin migrate --settings=swh.web.settings.tests -v0 2>/dev/null | django-admin migrate --settings=swh.web.settings.tests -v0 2>/dev/null | ||||
cat swh/web/tests/create_test_admin.py | django-admin shell --settings=swh.web.settings.tests | |||||
cat swh/web/tests/create_test_users.py | django-admin shell --settings=swh.web.settings.tests | |||||
.PHONY: clear-memcached | .PHONY: clear-memcached | ||||
clear-memcached: | clear-memcached: | ||||
echo "flush_all" | nc -q 2 localhost 11211 2>/dev/null | echo "flush_all" | nc -q 2 localhost 11211 2>/dev/null | ||||
run-django-webpack-devserver: run-migrations yarn-install | run-django-webpack-devserver: run-migrations add-test-users yarn-install | ||||
bash -c "trap 'trap - SIGINT SIGTERM ERR; kill %1' SIGINT SIGTERM ERR; $(YARN) start-dev & sleep 10 && cd swh/web && python3 manage.py runserver --nostatic --settings=swh.web.settings.development" | bash -c "trap 'trap - SIGINT SIGTERM ERR; kill %1' SIGINT SIGTERM ERR; $(YARN) start-dev & sleep 10 && cd swh/web && python3 manage.py runserver --nostatic --settings=swh.web.settings.development" | ||||
run-django-webpack-dev: build-webpack-dev run-migrations | run-django-webpack-dev: build-webpack-dev run-migrations | ||||
anlambert: this target should also depend on `add-test-users` | |||||
python3 swh/web/manage.py runserver --nostatic --settings=swh.web.settings.development | python3 swh/web/manage.py runserver --nostatic --settings=swh.web.settings.development | ||||
run-django-webpack-prod: build-webpack-prod run-migrations-prod clear-memcached | run-django-webpack-prod: build-webpack-prod run-migrations-prod clear-memcached | ||||
anlambertUnsubmitted Not Done Inline Actionssame here anlambert: same here | |||||
python3 swh/web/manage.py runserver --nostatic --settings=swh.web.settings.production | python3 swh/web/manage.py runserver --nostatic --settings=swh.web.settings.production | ||||
run-django-server-dev: run-migrations | run-django-server-dev: run-migrations | ||||
python3 swh/web/manage.py runserver --nostatic --settings=swh.web.settings.development | python3 swh/web/manage.py runserver --nostatic --settings=swh.web.settings.development | ||||
run-django-server-prod: run-migrations-prod clear-memcached | run-django-server-prod: run-migrations-prod clear-memcached | ||||
python3 swh/web/manage.py runserver --nostatic --settings=swh.web.settings.production | python3 swh/web/manage.py runserver --nostatic --settings=swh.web.settings.production | ||||
run-gunicorn-server: run-migrations-prod clear-memcached | run-gunicorn-server: run-migrations-prod clear-memcached | ||||
DJANGO_SETTINGS_MODULE=swh.web.settings.production \ | DJANGO_SETTINGS_MODULE=swh.web.settings.production \ | ||||
gunicorn --bind 127.0.0.1:5004 \ | gunicorn --bind 127.0.0.1:5004 \ | ||||
--threads 2 \ | --threads 2 \ | ||||
--workers 2 'django.core.wsgi:get_wsgi_application()' | --workers 2 'django.core.wsgi:get_wsgi_application()' | ||||
run-django-webpack-memory-storages: build-webpack-dev run-migrations | run-django-webpack-memory-storages: build-webpack-dev run-migrations | ||||
anlambertUnsubmitted Not Done Inline Actionssame here anlambert: same here | |||||
python3 swh/web/manage.py runserver --nostatic --settings=swh.web.settings.tests | python3 swh/web/manage.py runserver --nostatic --settings=swh.web.settings.tests | ||||
test-full: | test-full: | ||||
$(TEST) $(TESTFULL_FLAGS) $(TEST_DIRS) | $(TEST) $(TESTFULL_FLAGS) $(TEST_DIRS) | ||||
.PHONY: test-frontend-cmd | .PHONY: test-frontend-cmd | ||||
test-frontend-cmd: build-webpack-test run-migrations-test | test-frontend-cmd: build-webpack-test run-migrations-test add-test-users | ||||
python3 swh/web/manage.py runserver --nostatic --settings=swh.web.settings.tests & sleep 10 && $(YARN) run cypress run --config numTestsKeptInMemory=0 ; pkill -P $$! ; $(YARN) run mochawesome | python3 swh/web/manage.py runserver --nostatic --settings=swh.web.settings.tests & sleep 10 && $(YARN) run cypress run --config numTestsKeptInMemory=0 ; pkill -P $$! ; $(YARN) run mochawesome | ||||
test-frontend: export CYPRESS_SKIP_SLOW_TESTS=1 | test-frontend: export CYPRESS_SKIP_SLOW_TESTS=1 | ||||
test-frontend: test-frontend-cmd | test-frontend: test-frontend-cmd | ||||
test-frontend-full: export CYPRESS_SKIP_SLOW_TESTS=0 | test-frontend-full: export CYPRESS_SKIP_SLOW_TESTS=0 | ||||
test-frontend-full: test-frontend-cmd | test-frontend-full: test-frontend-cmd | ||||
.PHONY: test-frontend-ui-cmd | .PHONY: test-frontend-ui-cmd | ||||
test-frontend-ui-cmd: build-webpack-test run-migrations-test | test-frontend-ui-cmd: build-webpack-test run-migrations-test add-test-users | ||||
bash -c "trap 'trap - SIGINT SIGTERM ERR EXIT; jobs -p | head -1 | xargs pkill -P' SIGINT SIGTERM ERR EXIT; python3 swh/web/manage.py runserver --nostatic --settings=swh.web.settings.tests & sleep 10 && $(YARN) run cypress open" | bash -c "trap 'trap - SIGINT SIGTERM ERR EXIT; jobs -p | head -1 | xargs pkill -P' SIGINT SIGTERM ERR EXIT; python3 swh/web/manage.py runserver --nostatic --settings=swh.web.settings.tests & sleep 10 && $(YARN) run cypress open" | ||||
test-frontend-ui: export CYPRESS_SKIP_SLOW_TESTS=1 | test-frontend-ui: export CYPRESS_SKIP_SLOW_TESTS=1 | ||||
test-frontend-ui: test-frontend-ui-cmd | test-frontend-ui: test-frontend-ui-cmd | ||||
test-frontend-full-ui: export CYPRESS_SKIP_SLOW_TESTS=0 | test-frontend-full-ui: export CYPRESS_SKIP_SLOW_TESTS=0 | ||||
test-frontend-full-ui: test-frontend-ui-cmd | test-frontend-full-ui: test-frontend-ui-cmd | ||||
# Override default rule to make sure DJANGO env var is properly set. It | # Override default rule to make sure DJANGO env var is properly set. It | ||||
# *should* work without any override thanks to the mypy django-stubs plugin, | # *should* work without any override thanks to the mypy django-stubs plugin, | ||||
# but it currently doesn't; see | # but it currently doesn't; see | ||||
# https://github.com/typeddjango/django-stubs/issues/166 | # https://github.com/typeddjango/django-stubs/issues/166 | ||||
check-mypy: | check-mypy: | ||||
DJANGO_SETTINGS_MODULE=swh.web.settings.development $(MYPY) $(MYPYFLAGS) swh | DJANGO_SETTINGS_MODULE=swh.web.settings.development $(MYPY) $(MYPYFLAGS) swh |
this target should also depend on add-test-users