Makefile 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. VERSION = 2.0.0
  2. NPM_ROOT = node_modules
  3. STATIC_DIR = src/sentry/static/sentry
  4. BOOTSTRAP_JS = ${STATIC_DIR}/scripts/lib/bootstrap.js
  5. BOOTSTRAP_JS_MIN = ${STATIC_DIR}/scripts/lib/bootstrap.min.js
  6. UGLIFY_JS ?= node_modules/uglify-js/bin/uglifyjs
  7. develop: update-submodules
  8. npm install -q
  9. pip install -q "file://`pwd`#egg=sentry[dev]"
  10. pip install -q "file://`pwd`#egg=sentry[tests]"
  11. pip install -q -e . --use-mirrors
  12. dev-postgres:
  13. pip install -q "file://`pwd`#egg=sentry[dev]"
  14. pip install -q "file://`pwd`#egg=sentry[postgres]"
  15. pip install -q -e . --use-mirrors
  16. dev-mysql:
  17. pip install -q "file://`pwd`#egg=sentry[dev]"
  18. pip install -q "file://`pwd`#egg=sentry[mysql]"
  19. pip install -q -e . --use-mirrors
  20. build: locale
  21. clean:
  22. rm -r src/sentry/static/CACHE
  23. locale:
  24. cd src/sentry && sentry makemessages -l en
  25. cd src/sentry && sentry compilemessages
  26. update-transifex:
  27. pip install transifex-client
  28. tx push -s
  29. tx pull -a
  30. compile-bootstrap-js:
  31. @cat src/bootstrap/js/bootstrap-transition.js src/bootstrap/js/bootstrap-alert.js src/bootstrap/js/bootstrap-button.js src/bootstrap/js/bootstrap-carousel.js src/bootstrap/js/bootstrap-collapse.js src/bootstrap/js/bootstrap-dropdown.js src/bootstrap/js/bootstrap-modal.js src/bootstrap/js/bootstrap-tooltip.js src/bootstrap/js/bootstrap-popover.js src/bootstrap/js/bootstrap-scrollspy.js src/bootstrap/js/bootstrap-tab.js src/bootstrap/js/bootstrap-typeahead.js src/bootstrap/js/bootstrap-affix.js ${STATIC_DIR}/scripts/bootstrap-datepicker.js > ${BOOTSTRAP_JS}
  32. ${UGLIFY_JS} -nc ${BOOTSTRAP_JS} > ${BOOTSTRAP_JS_MIN};
  33. install-test-requirements:
  34. pip install -q "file://`pwd`#egg=sentry[tests]"
  35. update-submodules:
  36. git submodule init
  37. git submodule update
  38. test: install-test-requirements lint test-js test-python test-cli
  39. testloop: install-test-requirements
  40. pip install pytest-xdist --use-mirrors
  41. py.test tests -f
  42. test-cli:
  43. @echo "Testing CLI"
  44. rm -f test.conf
  45. sentry init test.conf
  46. sentry --config=test.conf help | grep start > /dev/null
  47. test-js:
  48. @echo "Running JavaScript tests"
  49. ${NPM_ROOT}/phantomjs/bin/phantomjs runtests.js tests/js/index.html
  50. @echo ""
  51. test-python:
  52. @echo "Running Python tests"
  53. python setup.py -q test || exit 1
  54. @echo ""
  55. lint: lint-python lint-js
  56. lint-python:
  57. @echo "Linting Python files"
  58. flake8 --exclude=migrations,src/sentry/static/CACHE/* --ignore=E501,E225,E121,E123,E124,E125,E127,E128 src/sentry
  59. @echo ""
  60. lint-js:
  61. @echo "Linting JavaScript files"
  62. @${NPM_ROOT}/jshint/bin/hint src/sentry/ || exit 1
  63. @echo ""
  64. coverage: install-test-requirements
  65. py.test --cov=src/sentry --cov-report=html
  66. run-uwsgi:
  67. uwsgi --http 127.0.0.1:8000 --need-app --disable-logging --wsgi-file src/sentry/wsgi.py --processes 1 --threads 5
  68. .PHONY: build