-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
83 lines (62 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
TASK ?= test
RUNNER ?= test
NODE_ENV ?= test
ifdef CI
TASK=test:ci
RUNNER=testc
endif
ifneq ($(wildcard .env),)
include .env
endif
GIT_REVISION=$(shell git rev-parse --short=7 HEAD)
export NODE_ENV GIT_REVISION
test-ci:
@make -s check test-all
@make -sC application ci
test-all:
@make -s $(RUNNER):bud $(RUNNER):cli $(RUNNER):grpc $(RUNNER):graphql $(RUNNER):model
@make -s $(RUNNER):repl $(RUNNER):test $(RUNNER):conn $(RUNNER):server $(RUNNER):access $(RUNNER):session
@make -s $(RUNNER):logger $(RUNNER):render $(RUNNER):router $(RUNNER):static $(RUNNER):tarima $(RUNNER):upload
ci: deps
@make -s clean setup test-ci codecov
testc\:%:
@make -s test:$* coverage:$*
codecov:
@curl -s https://codecov.io/bash > codecov.sh
@chmod +x codecov.sh
@./codecov.sh -p build/coverage -f '*.info' -F unit
coverage\:%:
@mkdir -p build/coverage
@((sed 's|$(PWD)/packages/$(subst coverage:,,$*)/||g' packages/$(subst coverage:,,$*)/coverage/lcov.info \
| sed 's|^SF:|SF:packages/$(subst coverage:,,$*)/|g' \
> build/coverage/$(subst coverage:,,$*).info) > /dev/null 2>&1) || true
publish:
@make -C website dist deploy
release: install
@mv lerna.json lerna.json_backup
@cat lerna.json_backup | grep -v application > lerna.json
@git update-index --assume-unchanged lerna.json
@lerna publish || true
@mv lerna.json_backup lerna.json
@git update-index --no-assume-unchanged lerna.json
install: deps
@(((which lerna) > /dev/null 2>&1) || npm i -g lerna) || true
setup: install
@lerna bootstrap
web\:%:
@make -C website $*
link\:%:
@rm -rf $(PWD)/application/node_modules/@grown/$*
@ln -s $(PWD)/packages/$* $(PWD)/application/node_modules/@grown/
dev\:%:
@cd packages/$(subst dev:,,$*) && npm run dev
test\:%:
@lerna run $(TASK) --scope @grown/$*
clean: install
@lerna clean -y --ignore grown
check: deps
@make -C application lint
@npm run lint
@echo "Done."
deps: package*.json
@(((ls node_modules | grep .) > /dev/null 2>&1) || npm i) || true