-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
46 lines (45 loc) · 987 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
42
43
44
45
46
#代替\换行
.ONESHELL:
PATH := node_modules/.bin:$(PATH)
SHELL := /bin/bash
PROJECT = "node project"
#设置node运行环境
dev_NODE_E = "development"
pro_NODE_E = "production"
#入口js文件
PROMAIN = ./build/index.js
DEVMAIN = ./server/babel.app.js
TESTS= ./server/test/router/*.js
MIGRATE = ./server/model/migrate.js
TIMEOUT = 10000
.PHONY: start migrate clean
devStart:
@export NODE_ENV=${dev_NODE_E};
@nodemon ${DEVMAIN}
proStart:
@rm ./build -rf
@export NODE_ENV=${pro_NODE_E};
@babel ./server -d ./build
@cp ./server/public ./build -rf
@cp ./server/views ./build -rf
@pm2 start ${PROMAIN}
proRestart:
@rm ./build -rf
@export NODE_ENV=${pro_NODE_E};
@babel ./server -d ./build
@cp ./server/public ./build -rf
@cp ./server/views ./build -rf
@pm2 restart ${PROMAIN}
stop:
@pm2 stop ${PROMAIN}
migrate:
@node ${MIGRATE}
install:
@echo ${PROJECT} "install";
@npm install
clean:
@rm -r ./build
tests:
@echo "test"
@mocha -t ${TIMEOUT} ${TESTS}
build: start