forked from getsentry/sentry-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
64 lines (53 loc) · 1.79 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
SENTRY_PATH := `python -c 'import sentry; print sentry.__file__.rsplit("/", 3)[0]'`
UNAME_S := $(shell uname -s)
develop: setup-git install-yarn
pip install "pip>=9,<10"
pip install -e git+https://github.com/getsentry/sentry.git#egg=sentry[dev]
pip install -e ".[tests]"
yarn install
install-yarn:
@echo "--> Installing Node dependencies"
@hash yarn 2> /dev/null || npm install -g yarn
# Use NODE_ENV=development so that yarn installs both dependencies + devDependencies
NODE_ENV=development yarn install --ignore-optional
install-tests: develop install-chromedriver
pip install .[tests]
setup-git:
@echo "--> Installing git hooks"
git config branch.autosetuprebase always
git config core.ignorecase false
cd .git/hooks && ln -sf ../../config/hooks/* ./
pip install "pre-commit>=1.10.1,<1.11.0"
pre-commit install
@echo ""
clean:
@echo "--> Cleaning static cache"
rm -f src/sentry_plugins/*/static/dist
@echo "--> Cleaning pyc files"
find . -name "*.pyc" -delete
@echo "--> Cleaning python build artifacts"
rm -rf build/ dist/ src/sentry_plugins/assets.json
@echo ""
install-chromedriver:
ifeq ($(UNAME_S), Darwin)
@echo "NOTE: Install chromedriver via Homebrew, with: brew install chromedriver"
else
wget -N http://chromedriver.storage.googleapis.com/2.33/chromedriver_linux64.zip -P ~/
unzip ~/chromedriver_linux64.zip -d ~/
rm ~/chromedriver_linux64.zip
chmod +x ~/chromedriver
mkdir -p ~/.bin
mv ~/chromedriver ~/.bin/
endif
lint: lint-js lint-python
lint-python:
@echo "--> Linting python"
bash -eo pipefail -c "flake8 | tee .artifacts/flake8.pycodestyle.log"
@echo ""
lint-js:
@echo "--> Linting javascript"
bash -eo pipefail -c "${SENTRY_PATH}/bin/lint --js --parseable . | tee .artifacts/eslint.codestyle.xml"
@echo ""
test: install-tests
py.test
.PHONY: develop install-tests