You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Makefile 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. # These targets are not files
  2. .PHONY: install sandbox docs coverage lint travis messages compiledmessages css clean preflight sandbox_image
  3. install:
  4. pip install -e . -r requirements.txt
  5. build_sandbox:
  6. # Remove media
  7. -rm -rf sites/sandbox/public/media/images
  8. -rm -rf sites/sandbox/public/media/cache
  9. -rm -rf sites/sandbox/public/static
  10. -rm -f sites/sandbox/db.sqlite
  11. # Create database
  12. sites/sandbox/manage.py migrate
  13. # Import some fixtures. Order is important as JSON fixtures include primary keys
  14. sites/sandbox/manage.py loaddata sites/sandbox/fixtures/child_products.json
  15. sites/sandbox/manage.py oscar_import_catalogue sites/sandbox/fixtures/*.csv
  16. sites/sandbox/manage.py oscar_import_catalogue_images sites/sandbox/fixtures/images.tar.gz
  17. sites/sandbox/manage.py oscar_populate_countries
  18. sites/sandbox/manage.py loaddata sites/_fixtures/pages.json sites/_fixtures/auth.json sites/_fixtures/ranges.json sites/_fixtures/offers.json
  19. sites/sandbox/manage.py loaddata sites/sandbox/fixtures/orders.json
  20. sites/sandbox/manage.py clear_index --noinput
  21. sites/sandbox/manage.py update_index catalogue
  22. sandbox: install build_sandbox
  23. sandbox_image:
  24. docker build -t django-oscar-sandbox:latest .
  25. docs:
  26. cd docs && make html
  27. coverage:
  28. coverage run ./runtests.py --with-xunit
  29. coverage xml -i
  30. lint:
  31. ./lint.sh
  32. testmigrations:
  33. pip install -r requirements_migrations.txt
  34. cd sites/sandbox && ./test_migrations.sh
  35. # This target is run on Travis.ci. We lint, test and build the sandbox
  36. # site as well as testing migrations apply correctly. We don't call 'install'
  37. # first as that is run as a separate part of the Travis build process.
  38. travis: coverage lint build_sandbox testmigrations
  39. messages:
  40. # Create the .po files used for i18n
  41. cd src/oscar; django-admin.py makemessages -a
  42. compiledmessages:
  43. # Compile the gettext files
  44. cd src/oscar; django-admin.py compilemessages
  45. css:
  46. npm install
  47. npm run build
  48. clean:
  49. # Remove files not in source control
  50. find . -type f -name "*.pyc" -delete
  51. rm -rf nosetests.xml coverage.xml htmlcov *.egg-info *.pdf dist violations.txt
  52. preflight: lint
  53. # Bare minimum of tests to run before pushing to master
  54. ./runtests.py
  55. todo:
  56. # Look for areas of the code that need updating when some event has taken place (like
  57. # Oscar dropping support for a Django version)
  58. -grep -rnH TODO *.txt
  59. -grep -rnH TODO src/oscar/apps/
  60. -grep -rnH "django.VERSION" src/oscar/apps