-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (31 loc) · 964 Bytes
/
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
TESTS = $(shell find test -type f -name "*.test.js")
TEST_TIMEOUT = 5000
MOCHA_REPORTER = spec
NPM_REGISTRY = "--registry=http://registry.npm.taobao.org"
all: test
install:
@npm install $(NPM_REGISTRY)
pretest:
@if ! test -f config.js; then \
cp config.default.js config.js; \
fi
test: install pretest
@NODE_ENV=test ./node_modules/mocha/bin/mocha \
--reporter $(MOCHA_REPORTER) \
--timeout $(TEST_TIMEOUT) \
$(TESTS)
test-cov cov: install pretest
@NODE_ENV=test node \
node_modules/.bin/istanbul cover --preserve-comments \
./node_modules/.bin/_mocha \
-- \
--reporter $(MOCHA_REPORTER) \
--timeout $(TEST_TIMEOUT) \
$(TESTS)
build:
@./node_modules/loader/bin/build views .
start: install build
@nohup ./node_modules/.bin/pm2 start app.js -i max --name "cnode" >> cnode.log 2>&1 &
restart: install build
@nohup ./node_modules/.bin/pm2 restart "cnode" >> cnode.log 2>&1 &
.PHONY: install test cov test-cov build start restart