forked from Yelp/beans
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
57 lines (46 loc) · 1.51 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
VIRTUALENV_REQUIREMENTS = requirements.txt requirements-dev.txt
SOURCES := $(shell find js -name '*.jsx' -o -name '*.js')
.PHONY: all
all: development
.PHONY: deploy
deploy: production
gcloud app deploy --project yelp-beans --version 1
.PHONY: production
production: export VIRTUALENV_REQUIREMENTS = requirements.txt
production: export NODE_ENV = "production"
production: venv touch.webpack.prod
.PHONY: development
development: venv touch.webpack.dev install-hooks
.PHONY: install-hooks
install-hooks: venv
./venv/bin/pre-commit install -f --install-hooks
touch.webpack.%: export PRODUCTION_FLAG = $(shell [ "$(NODE_ENV)" == "production" ] && echo "-p")
touch.webpack.%: $(SOURCES) node_modules webpack.config.js .babelrc package.json
npm run webpack -- $(PRODUCTION_FLAG)
touch "$@"
.PHONY: test
test: development install-hooks
./venv/bin/coverage run -m py.test tests/
./venv/bin/coverage report --show-missing
./venv/bin/coverage html
./venv/bin/pre-commit run --all-files
./venv/bin/check-requirements
npm run eslint
npm test
node_modules: package.json
npm install
venv: $(VIRTUALENV_REQUIREMENTS) bin/venv-update
./bin/venv-update \
venv= venv/ --python=python2.7 \
install= $(patsubst %,-r %,$(VIRTUALENV_REQUIREMENTS)) \
bootstrap-deps= -r requirements-bootstrap.txt \
pip-command= pymonkey pip-custom-platform -- pip-faster install --upgrade --prune
rm -rf $@/local
.PHONY: serve
serve: development
dev_appserver.py .
.PHONY: clean
clean:
rm -rf venv/
rm -rf node_modules/
rm -rf dist/