Makefile 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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. JS_TESTS = tests/js/index.html
  8. JS_REPORTER = dot
  9. develop: update-submodules setup-git
  10. @echo "--> Installing dependencies"
  11. npm install
  12. pip install "setuptools>=0.9.8"
  13. # order matters here, base package must install first
  14. pip install -e .
  15. pip install "file://`pwd`#egg=sentry[dev]"
  16. pip install "file://`pwd`#egg=sentry[tests]"
  17. @echo ""
  18. dev-postgres: develop
  19. pip install "file://`pwd`#egg=sentry[postgres]"
  20. dev-mysql: develop
  21. pip install "file://`pwd`#egg=sentry[mysql]"
  22. dev-docs:
  23. pip install -r docs/requirements.txt
  24. setup-git:
  25. @echo "--> Installing git hooks"
  26. git config branch.autosetuprebase always
  27. cd .git/hooks && ln -sf ../../hooks/* ./
  28. @echo ""
  29. build: locale
  30. clean:
  31. @echo "--> Cleaning static cache"
  32. rm -rf src/sentry/static/CACHE
  33. @echo "--> Cleaning pyc files"
  34. find . -name "*.pyc" -delete
  35. @echo ""
  36. locale:
  37. cd src/sentry && sentry makemessages -i static -l en
  38. cd src/sentry && sentry compilemessages
  39. update-transifex:
  40. pip install transifex-client
  41. tx push -s
  42. tx pull -a
  43. compile-bootstrap-js:
  44. @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}
  45. ${UGLIFY_JS} -nc ${BOOTSTRAP_JS} > ${BOOTSTRAP_JS_MIN};
  46. update-submodules:
  47. @echo "--> Updating git submodules"
  48. git submodule init
  49. git submodule update
  50. @echo ""
  51. test: develop lint test-js test-python test-cli
  52. testloop: develop
  53. pip install pytest-xdist
  54. py.test tests -f
  55. test-cli:
  56. @echo "--> Testing CLI"
  57. rm -rf test_cli
  58. mkdir test_cli
  59. cd test_cli && sentry init test.conf > /dev/null
  60. cd test_cli && sentry --config=test.conf upgrade --traceback --noinput > /dev/null
  61. cd test_cli && sentry --config=test.conf help | grep start > /dev/null
  62. rm -r test_cli
  63. @echo ""
  64. test-js:
  65. @echo "--> Running JavaScript tests"
  66. ${NPM_ROOT}/.bin/mocha-phantomjs -p ${NPM_ROOT}/phantomjs/bin/phantomjs -R ${JS_REPORTER} ${JS_TESTS}
  67. @echo ""
  68. test-python:
  69. @echo "--> Running Python tests"
  70. py.test tests || exit 1
  71. @echo ""
  72. lint: lint-python lint-js
  73. lint-python:
  74. @echo "--> Linting Python files"
  75. PYFLAKES_NODOCTEST=1 flake8 src/sentry tests
  76. @echo ""
  77. lint-js:
  78. @echo "--> Linting JavaScript files"
  79. ${NPM_ROOT}/.bin/jshint src/sentry/ || exit 1
  80. @echo ""
  81. coverage: develop
  82. coverage run --source=src/sentry -m py.test
  83. coverage html
  84. run-uwsgi:
  85. uwsgi --http 127.0.0.1:8000 --need-app --disable-logging --wsgi-file src/sentry/wsgi.py --processes 1 --threads 5
  86. publish:
  87. python setup.py sdist bdist_wheel upload
  88. .PHONY: develop dev-postgres dev-mysql dev-docs setup-git build clean locale update-transifex compile-bootstrap-js update-submodules test testloop test-cli test-js test-python lint lint-python lint-js coverage run-uwsgi publish