-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
185 lines (143 loc) · 4.84 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
NPM_ROOT = ./node_modules
STATIC_DIR = src/sentry/static/sentry
install-python:
@echo "--> Installing Python dependencies"
pip install "setuptools>=0.9.8"
# order matters here, base package must install first
pip install -e .
pip install "file://`pwd`#egg=sentry[dev]"
install-npm:
@echo "--> Installing Node dependencies"
npm install
install-python-tests:
pip install "file://`pwd`#egg=sentry[dev,tests]"
develop-only: update-submodules install-python install-python-tests install-npm
develop: update-submodules setup-git develop-only install-python-tests
@echo ""
dev-postgres: install-python
pip install "file://`pwd`#egg=sentry[postgres]"
dev-docs:
pip install -r doc-requirements.txt
reset-db:
@echo "--> Dropping existing 'sentry' database"
dropdb sentry || true
@echo "--> Creating 'sentry' database"
createdb -E utf-8 sentry
@echo "--> Applying migrations"
sentry upgrade
setup-git:
@echo "--> Installing git hooks"
git config branch.autosetuprebase always
cd .git/hooks && ln -sf ../../hooks/* ./
@echo ""
build: locale
clean:
@echo "--> Cleaning static cache"
rm -f dist/* static/dist/*
@echo "--> Cleaning integration docs cache"
rm -rf src/sentry/integration-docs
@echo "--> Cleaning pyc files"
find . -name "*.pyc" -delete
@echo "--> Cleaning python build artifacts"
rm -rf build/ dist/ sentry-package.json
@echo ""
build-js-po:
mkdir -p build
SENTRY_EXTRACT_TRANSLATIONS=1 ./node_modules/.bin/webpack
locale: build-js-po
cd src/sentry && sentry django makemessages -i static -l en
./bin/merge-catalogs en
./bin/find-good-catalogs src/sentry/locale/catalogs.json
cd src/sentry && sentry django compilemessages
update-transifex: build-js-po
pip install transifex-client
cd src/sentry && sentry django makemessages -i static -l en
./bin/merge-catalogs en
tx push -s
tx pull -a
./bin/find-good-catalogs src/sentry/locale/catalogs.json
cd src/sentry && sentry django compilemessages
update-submodules:
@echo "--> Updating git submodules"
git submodule init
git submodule update
@echo ""
test: develop lint test-js test-python test-cli
testloop: develop
pip install pytest-xdist
py.test tests -f
test-cli:
@echo "--> Testing CLI"
rm -rf test_cli
mkdir test_cli
cd test_cli && sentry init test_conf > /dev/null
cd test_cli && sentry --config=test_conf upgrade --traceback --noinput > /dev/null
cd test_cli && sentry --config=test_conf help 2>&1 | grep start > /dev/null
rm -r test_cli
@echo ""
test-js:
@echo "--> Running JavaScript tests"
@${NPM_ROOT}/.bin/webpack
@npm run test
@echo ""
test-python:
@echo "--> Running Python tests"
py.test tests || exit 1
@echo ""
test-python-coverage:
@echo "--> Running Python tests"
coverage run --source=src/sentry,tests -m py.test tests
@echo ""
lint: lint-python lint-js
lint-python:
@echo "--> Linting python"
bin/lint --python
@echo ""
lint-js:
@echo "--> Linting javascript"
bin/lint --js
@echo ""
coverage: develop
make test-python-coverage
coverage html
run-uwsgi:
uwsgi --http 127.0.0.1:8000 --need-app --disable-logging --wsgi-file src/sentry/wsgi.py --processes 1 --threads 5
publish:
python setup.py sdist bdist_wheel upload
extract-api-docs:
rm -rf api-docs/cache/*
cd api-docs; python generator.py
.PHONY: develop dev-postgres dev-docs setup-git build clean locale update-transifex update-submodules test testloop test-cli test-js test-python test-python-coverage lint lint-python lint-js coverage run-uwsgi publish
############################
# Halt, Travis stuff below #
############################
# Bases for all builds
travis-upgrade-pip:
python -m pip install --upgrade pip==7.1.2
travis-setup-cassandra:
echo "create keyspace sentry with replication = {'class' : 'SimpleStrategy', 'replication_factor': 1};" | cqlsh --cqlversion=3.0.3
echo 'create table nodestore (key text primary key, value blob, flags int);' | cqlsh -k sentry --cqlversion=3.0.3
travis-install-python: travis-upgrade-pip install-python-tests travis-setup-cassandra
python -m pip install codecov
travis-noop:
@echo "nothing to do here."
.PHONY: travis-upgrade-pip travis-setup-cassandra travis-install-python travis-noop
# Install steps
travis-install-sqlite: travis-install-python
travis-install-postgres: travis-install-python dev-postgres
psql -c 'create database sentry;' -U postgres
travis-install-js: install-npm
travis-install-cli: travis-install-python
.PHONY: travis-install-sqlite travis-install-postgres travis-install-js travis-install-cli
# Lint steps
travis-lint-sqlite: lint-python
travis-lint-postgres: lint-python
travis-lint-js: lint-js
travis-lint-cli: travis-noop
.PHONY: travis-lint-sqlite travis-lint-postgres travis-lint-js travis-lint-cli
# Test steps
travis-test-sqlite: test-python-coverage
travis-test-postgres: test-python-coverage
travis-test-js: test-js
travis-test-ci: test-ci
.PHONY: travis-test-sqlite travis-test-postgres travis-test-js travis-test-cli