Makefile 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. NPM_ROOT = ./node_modules
  2. STATIC_DIR = src/sentry/static/sentry
  3. develop: update-submodules setup-git
  4. @echo "--> Installing dependencies"
  5. npm install
  6. pip install "setuptools>=0.9.8"
  7. # order matters here, base package must install first
  8. pip install -e .
  9. pip install "file://`pwd`#egg=sentry[dev]"
  10. pip install "file://`pwd`#egg=sentry[tests]"
  11. @echo ""
  12. dev-postgres: develop
  13. pip install "file://`pwd`#egg=sentry[postgres]"
  14. dev-mysql: develop
  15. pip install "file://`pwd`#egg=sentry[mysql]"
  16. dev-docs:
  17. pip install -r doc-requirements.txt
  18. reset-db:
  19. @echo "--> Dropping existing 'sentry' database"
  20. dropdb sentry || true
  21. @echo "--> Creating 'sentry' database"
  22. createdb -E utf-8 sentry
  23. @echo "--> Applying migrations"
  24. sentry upgrade
  25. setup-git:
  26. @echo "--> Installing git hooks"
  27. git config branch.autosetuprebase always
  28. cd .git/hooks && ln -sf ../../hooks/* ./
  29. @echo ""
  30. build: locale
  31. clean:
  32. @echo "--> Cleaning static cache"
  33. ${NPM_ROOT}/.bin/gulp clean
  34. @echo "--> Cleaning pyc files"
  35. find . -name "*.pyc" -delete
  36. @echo ""
  37. locale:
  38. cd src/sentry && sentry makemessages -i static -l en
  39. cd src/sentry && sentry compilemessages
  40. update-transifex:
  41. pip install transifex-client
  42. cd src/sentry && sentry makemessages -i static -l en
  43. tx push -s
  44. tx pull -a
  45. cd src/sentry && sentry compilemessages
  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 2>&1 | grep start > /dev/null
  62. rm -r test_cli
  63. @echo ""
  64. test-js:
  65. @echo "--> Running JavaScript tests"
  66. @npm install
  67. @webpack
  68. @npm run test
  69. @echo ""
  70. test-python:
  71. @echo "--> Running Python tests"
  72. py.test tests || exit 1
  73. @echo ""
  74. lint: lint-python lint-js
  75. lint-python:
  76. @echo "--> Linting Python files"
  77. PYFLAKES_NODOCTEST=1 flake8 src/sentry tests
  78. @echo ""
  79. lint-js:
  80. @echo "--> Linting JavaScript files"
  81. @npm install
  82. @npm run lint
  83. @echo ""
  84. coverage: develop
  85. coverage run --source=src/sentry -m py.test
  86. coverage html
  87. run-uwsgi:
  88. uwsgi --http 127.0.0.1:8000 --need-app --disable-logging --wsgi-file src/sentry/wsgi.py --processes 1 --threads 5
  89. publish:
  90. python setup.py sdist bdist_wheel upload
  91. .PHONY: develop dev-postgres dev-mysql dev-docs setup-git build clean locale update-transifex update-submodules test testloop test-cli test-js test-python lint lint-python lint-js coverage run-uwsgi publish