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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. # These targets are not files
  2. .PHONY: install sandbox geoip demo docs coverage lint travis messages compiledmessages css clean preflight
  3. install:
  4. pip install -r requirements.txt
  5. python setup.py develop
  6. sandbox: install
  7. # Remove media
  8. -rm -rf sites/sandbox/public/media/images
  9. -rm -rf sites/sandbox/public/media/cache
  10. -rm -rf sites/sandbox/public/static
  11. -rm -f sites/sandbox/db.sqlite
  12. # Create database
  13. # 'syncdb' is identical to migrate in Django 1.7+; but calling it twice should have no effect
  14. sites/sandbox/manage.py syncdb --noinput
  15. sites/sandbox/manage.py migrate
  16. # Import some fixtures. Order is important as JSON fixtures include primary keys
  17. sites/sandbox/manage.py loaddata sites/sandbox/fixtures/child_products.json
  18. sites/sandbox/manage.py oscar_import_catalogue sites/sandbox/fixtures/*.csv
  19. sites/sandbox/manage.py oscar_import_catalogue_images sites/sandbox/fixtures/images.tar.gz
  20. sites/sandbox/manage.py oscar_populate_countries
  21. sites/sandbox/manage.py loaddata sites/_fixtures/pages.json sites/_fixtures/auth.json sites/_fixtures/ranges.json sites/_fixtures/offers.json
  22. sites/sandbox/manage.py clear_index --noinput
  23. sites/sandbox/manage.py update_index catalogue
  24. geoip:
  25. wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
  26. gunzip GeoLiteCity.dat.gz
  27. mv GeoLiteCity.dat sites/demo/geoip
  28. demo: install
  29. # Install additional requirements
  30. pip install -r requirements_demo.txt
  31. # Create database
  32. # Breaks on Travis because of https://github.com/django-extensions/django-extensions/issues/489
  33. if [ -z "$(TRAVIS)" ]; then sites/demo/manage.py reset_db --router=default --noinput; fi
  34. sites/demo/manage.py syncdb --noinput
  35. sites/demo/manage.py migrate
  36. # Import some core fixtures
  37. sites/demo/manage.py oscar_populate_countries
  38. sites/demo/manage.py loaddata sites/_fixtures/pages.json
  39. # Create catalogue (create product classes from fixture than import CSV files)
  40. sites/demo/manage.py loaddata sites/_fixtures/auth.json sites/demo/fixtures/offers.json
  41. sites/demo/manage.py loaddata sites/demo/fixtures/product-classes.json sites/demo/fixtures/product-attributes.json sites/demo/fixtures/shipping-event-types.json
  42. sites/demo/manage.py create_demo_products --class=Books sites/demo/fixtures/books.csv
  43. sites/demo/manage.py create_demo_products --class=Downloads sites/demo/fixtures/downloads.csv
  44. sites/demo/manage.py create_demo_products --class=Clothing sites/demo/fixtures/clothing.csv
  45. sites/demo/manage.py oscar_import_catalogue_images sites/demo/fixtures/images.tar.gz
  46. # Update search index
  47. sites/demo/manage.py clear_index --noinput
  48. sites/demo/manage.py update_index catalogue
  49. us_site: install
  50. # Install additional requirements
  51. pip install -r requirements_us.txt
  52. # Create database
  53. sites/us/manage.py reset_db --router=default --noinput
  54. sites/us/manage.py syncdb --noinput
  55. sites/us/manage.py migrate
  56. # Import some fixtures
  57. sites/us/manage.py oscar_populate_countries
  58. sites/us/manage.py loaddata sites/us/fixtures/*.json
  59. sites/us/manage.py loaddata sites/_fixtures/auth.json sites/_fixtures/ranges.json
  60. # Create catalogue (using a fixture from the demo site)
  61. sites/us/manage.py create_demo_products --class=Books sites/demo/fixtures/books.csv
  62. docs:
  63. cd docs && make html
  64. coverage:
  65. coverage run ./runtests.py --with-xunit
  66. coverage xml -i
  67. lint:
  68. ./lint.sh
  69. testmigrations:
  70. pip install -r requirements_migrations.txt
  71. cd sites/sandbox && ./test_migrations.sh
  72. # This target is run on Travis.ci. We lint, test and build the sandbox/demo sites as well
  73. # as testing migrations apply correctly. We don't call 'install' first as that is run
  74. # as a separate part of the Travis build process.
  75. travis: lint coverage sandbox demo testmigrations
  76. messages:
  77. # Create the .po files used for i18n
  78. cd oscar; django-admin.py makemessages -a
  79. compiledmessages:
  80. # Compile the gettext files
  81. cd oscar; django-admin.py compilemessages
  82. css:
  83. # Compile CSS files from LESS
  84. lessc --source-map --source-map-less-inline oscar/static/oscar/less/styles.less oscar/static/oscar/css/styles.css
  85. lessc --source-map --source-map-less-inline oscar/static/oscar/less/responsive.less oscar/static/oscar/css/responsive.css
  86. lessc --source-map --source-map-less-inline oscar/static/oscar/less/dashboard.less oscar/static/oscar/css/dashboard.css
  87. # Compile CSS for demo site
  88. lessc --source-map --source-map-less-inline sites/demo/static/demo/less/styles.less sites/demo/static/demo/css/styles.css
  89. lessc --source-map --source-map-less-inline sites/demo/static/demo/less/responsive.less sites/demo/static/demo/css/responsive.css
  90. clean:
  91. # Remove files not in source control
  92. find . -type f -name "*.pyc" -delete
  93. rm -rf nosetests.xml coverage.xml htmlcov *.egg-info *.pdf dist violations.txt
  94. preflight: lint
  95. # Bare minimum of tests to run before pushing to master
  96. ./runtests.py
  97. todo:
  98. # Look for areas of the code that need updating when some event has taken place (like
  99. # Oscar dropping support for a Django version)
  100. -grep -rnH TODO *.txt
  101. -grep -rnH TODO oscar/apps/
  102. -grep -rnH "django.VERSION" oscar/apps