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.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. # These targets are not files
  2. .PHONY: install sandbox geoip demo docs coverage lint travis messages compiledmessages puppet 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. sites/sandbox/manage.py syncdb --noinput
  14. sites/sandbox/manage.py migrate
  15. # Import some fixtures. Order is important as JSON fixtures include primary keys
  16. sites/sandbox/manage.py loaddata sites/sandbox/fixtures/child_products.json
  17. sites/sandbox/manage.py oscar_import_catalogue sites/sandbox/fixtures/*.csv
  18. sites/sandbox/manage.py oscar_import_catalogue_images sites/sandbox/fixtures/images.tar.gz
  19. sites/sandbox/manage.py oscar_populate_countries
  20. sites/sandbox/manage.py loaddata sites/_fixtures/pages.json sites/_fixtures/auth.json sites/_fixtures/ranges.json sites/_fixtures/offers.json
  21. sites/sandbox/manage.py clear_index --noinput
  22. sites/sandbox/manage.py update_index catalogue
  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. demo: install
  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 syncdb --noinput
  34. sites/demo/manage.py migrate
  35. # Import some core fixtures
  36. sites/demo/manage.py oscar_populate_countries
  37. sites/demo/manage.py loaddata sites/_fixtures/pages.json
  38. # Create catalogue (create product classes from fixture than import CSV files)
  39. sites/demo/manage.py loaddata sites/_fixtures/auth.json sites/demo/fixtures/offers.json
  40. sites/demo/manage.py loaddata sites/demo/fixtures/product-classes.json sites/demo/fixtures/product-attributes.json sites/demo/fixtures/shipping-event-types.json
  41. sites/demo/manage.py create_demo_products --class=Books sites/demo/fixtures/books.csv
  42. sites/demo/manage.py create_demo_products --class=Downloads sites/demo/fixtures/downloads.csv
  43. sites/demo/manage.py create_demo_products --class=Clothing sites/demo/fixtures/clothing.csv
  44. sites/demo/manage.py oscar_import_catalogue_images sites/demo/fixtures/images.tar.gz
  45. # Update search index
  46. sites/demo/manage.py clear_index --noinput
  47. sites/demo/manage.py update_index catalogue
  48. us_site: install
  49. # Install additional requirements
  50. pip install -r requirements_us.txt
  51. # Create database
  52. sites/us/manage.py reset_db --router=default --noinput
  53. sites/us/manage.py syncdb --noinput
  54. sites/us/manage.py migrate
  55. # Import some fixtures
  56. sites/us/manage.py oscar_populate_countries
  57. sites/us/manage.py loaddata sites/us/fixtures/*.json
  58. sites/us/manage.py loaddata sites/_fixtures/auth.json sites/_fixtures/ranges.json
  59. # Create catalogue (using a fixture from the demo site)
  60. sites/us/manage.py create_demo_products --class=Books sites/demo/fixtures/books.csv
  61. docs:
  62. cd docs && make html
  63. coverage:
  64. coverage run ./runtests.py --with-xunit
  65. coverage xml -i
  66. lint:
  67. ./lint.sh
  68. testmigrations:
  69. pip install -r requirements_vagrant.txt
  70. cd sites/sandbox && ./test_migrations.sh
  71. # It is important that this target only depends on install
  72. # (instead of upgrade) because we install Django in the .travis.yml
  73. # and upgrade would overwrite it. We also build the sandbox as part of this target
  74. # to catch any errors that might come from that build process.
  75. travis: install 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. puppet:
  83. # Install puppet modules required to set-up a Vagrant box
  84. mkdir -p sites/puppet/modules
  85. rm -rf sites/puppet/modules/*
  86. puppet module install --target-dir sites/puppet/modules/ saz-memcached -v 2.0.2
  87. puppet module install --target-dir sites/puppet/modules/ puppetlabs/mysql
  88. puppet module install --target-dir sites/puppet/modules/ puppetlabs/apache
  89. puppet module install --target-dir sites/puppet/modules/ dhutty/nginx
  90. git clone git://github.com/akumria/puppet-postgresql.git sites/puppet/modules/postgresql
  91. git clone git://github.com/puppetmodules/puppet-module-python.git sites/puppet/modules/python
  92. git clone git://github.com/codeinthehole/puppet-userconfig.git sites/puppet/modules/userconfig
  93. css:
  94. # Compile CSS files from LESS
  95. lessc oscar/static/oscar/less/styles.less > oscar/static/oscar/css/styles.css
  96. lessc oscar/static/oscar/less/responsive.less > oscar/static/oscar/css/responsive.css
  97. lessc oscar/static/oscar/less/dashboard.less > oscar/static/oscar/css/dashboard.css
  98. # Compile CSS for demo site
  99. lessc sites/demo/static/demo/less/styles.less > sites/demo/static/demo/css/styles.css
  100. lessc sites/demo/static/demo/less/responsive.less > sites/demo/static/demo/css/responsive.css
  101. clean:
  102. # Remove files not in source control
  103. find . -type f -name "*.pyc" -delete
  104. rm -rf nosetests.xml coverage.xml htmlcov *.egg-info *.pdf dist violations.txt
  105. preflight: lint
  106. # Bare minimum of tests to run before pushing to master
  107. ./runtests.py