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 3.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. # These targets are not files
  2. .PHONY: install sandbox geoip demo docs coverage lint travis messages compiledmessages css clean preflight make_sandbox make_demo
  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. geoip:
  24. wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
  25. gunzip GeoLiteCity.dat.gz
  26. mv GeoLiteCity.dat sites/demo/geoip
  27. build_demo:
  28. # Install additional requirements
  29. pip install -r requirements_demo.txt
  30. # Create database
  31. # Breaks on Travis because of https://github.com/django-extensions/django-extensions/issues/489
  32. if [ -z "$(TRAVIS)" ]; then sites/demo/manage.py reset_db --router=default --noinput; fi
  33. sites/demo/manage.py migrate
  34. # Import some core fixtures
  35. sites/demo/manage.py oscar_populate_countries
  36. sites/demo/manage.py loaddata sites/_fixtures/pages.json
  37. # Create catalogue (create product classes from fixture than import CSV files)
  38. sites/demo/manage.py loaddata sites/_fixtures/auth.json sites/demo/fixtures/offers.json
  39. sites/demo/manage.py loaddata sites/demo/fixtures/product-classes.json sites/demo/fixtures/product-attributes.json sites/demo/fixtures/shipping-event-types.json
  40. sites/demo/manage.py create_demo_products --class=Books sites/demo/fixtures/books.csv
  41. sites/demo/manage.py create_demo_products --class=Downloads sites/demo/fixtures/downloads.csv
  42. sites/demo/manage.py create_demo_products --class=Clothing sites/demo/fixtures/clothing.csv
  43. sites/demo/manage.py oscar_import_catalogue_images sites/demo/fixtures/images.tar.gz
  44. # Update search index
  45. sites/demo/manage.py clear_index --noinput
  46. sites/demo/manage.py update_index catalogue
  47. demo: install build_demo
  48. docs:
  49. cd docs && make html
  50. coverage:
  51. coverage run ./runtests.py --with-xunit
  52. coverage xml -i
  53. lint:
  54. ./lint.sh
  55. testmigrations:
  56. pip install -r requirements_migrations.txt
  57. cd sites/sandbox && ./test_migrations.sh
  58. # This target is run on Travis.ci. We lint, test and build the sandbox/demo
  59. # sites as well as testing migrations apply correctly. We don't call 'install'
  60. # first as that is run as a separate part of the Travis build process.
  61. travis: coverage lint build_sandbox build_demo testmigrations
  62. messages:
  63. # Create the .po files used for i18n
  64. cd src/oscar; django-admin.py makemessages -a
  65. compiledmessages:
  66. # Compile the gettext files
  67. cd src/oscar; django-admin.py compilemessages
  68. css:
  69. npm install
  70. npm run build
  71. clean:
  72. # Remove files not in source control
  73. find . -type f -name "*.pyc" -delete
  74. rm -rf nosetests.xml coverage.xml htmlcov *.egg-info *.pdf dist violations.txt
  75. preflight: lint
  76. # Bare minimum of tests to run before pushing to master
  77. ./runtests.py
  78. todo:
  79. # Look for areas of the code that need updating when some event has taken place (like
  80. # Oscar dropping support for a Django version)
  81. -grep -rnH TODO *.txt
  82. -grep -rnH TODO src/oscar/apps/
  83. -grep -rnH "django.VERSION" src/oscar/apps