-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathMakefile
62 lines (49 loc) · 1.94 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
BIN_MOCHA = ./node_modules/.bin/_mocha
BIN_ISTANBUL = ./node_modules/.bin/istanbul
REGISTRY = https://registry.npm.taobao.org
VERSION = $(shell cat package.json | awk -F '"' '/version" *: *"/{print $$4}')
BUILD_NO = $(shell cat package.json | awk -F '"' '/build" *: *"/{print $$4}')
TESTS_ENV = test/env.js
install:
@npm install --registry=${REGISTRY}
@cd assets && npm install --registry=${REGISTRY}
test:
NODE_ENV=test $(BIN_MOCHA) \
--recursive \
-t 30000 \
-R spec \
-r $(TESTS_ENV) \
$(TESTS)
release: clean
@mkdir -p ./out/release
@rsync -av . ./out/release --exclude .git --exclude tests --exclude out --exclude node_modules --exclude run --exclude logs
@cd out/release/assets && NODE_ENV=production npm install --registry=${REGISTRY}
@cd out/release && NODE_ENV=production npm install --registry=${REGISTRY}
@cd out/release/assets && NODE_ENV=production ./node_modules/.bin/honeypack build && mv .package ../
@rm -rf out/release/assets/
@mkdir -p out/release/assets
@cd out/release && cp -r .package/* ./assets/
@cd out/release/config && cat config_production.js > config.js
test-cov:
@$(BIN_ISTANBUL) cover ${BIN_MOCHA} -- \
--recursive \
-t 60000 \
-R tap \
-r $(TESTS_ENV) \
test
package: release
@cd out/release/config && cat config_production.js > config.js
@cd out && mv release admin_$(VERSION)_$(BUILD_NO)
@cd out && tar -czf admin_$(VERSION)_$(BUILD_NO).tgz admin_$(VERSION)_$(BUILD_NO)
daily: release
@cd out/release/config && cat config_daily.js > config.js
@cd out && mv release admin_$(VERSION)_$(BUILD_NO)
@cd out && tar -czf honeycomb-console_$(VERSION)_$(BUILD_NO).tgz admin_$(VERSION)_$(BUILD_NO)
clean:
@rm -rf ./out
tag:
@cat package.json | awk -F '"' '/version" *: *"/{print "v"$$4}' | xargs -I {} git tag {}
release-linux:
docker run -it --rm -v $(shell pwd):/workspace centos/nodejs-8-centos7 /bin/bash -c \
"cd /workspace && registry=https://registry.npm.taobao.org make package"
.PHONY: install test