This repository has been archived by the owner on Nov 8, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 37
/
Makefile
executable file
·188 lines (169 loc) · 3.45 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
include Makefile.include.mk
before_action:
@chmod 755 $(JSON_CLI)
help:
$(call serve.help)
$(call gen.help)
$(call commit.help)
$(call release.help)
$(call deploy.help)
$(call test.help)
$(call dashboard.help)
$(call ci.help)
$(call github.help)
@echo "\n"
init:
npm install
dep:
npm install # for commitizen
dev: before_action
@$(JSON_CLI) -s '.[0] * .[1]' config/config.json config/config.dev.json > /tmp/config.json
@cp /tmp/config.json ./config/config.json
npm run update.version
npm run dev
build:
npm build
build.dev: before_action
@$(JSON_CLI) -s '.[0] * .[1]' config/config.json config/config.dev.json > /tmp/config.json
@cp /tmp/config.json ./config/config.json
npm run build.dev
build.prod: before_action
@$(JSON_CLI) -s '.[0] * .[1]' config/config.json config/config.prod.json > /tmp/config.json
@cp /tmp/config.json ./config/config.json
npm run build.prod
serve.help:
$(call serve.help)
@echo "\n"
serve:
$(call serve.help)
@echo "\n"
serve.dev:
npm run serve.dev
serve.prod:
npm run serve.prod
gen.help:
$(call gen.help)
@echo "\n"
gen:
npm run gen
commit.help:
$(call commit.help)
@echo "\n"
commit:
npx git-cz
# release
release.help:
$(call release.help)
@echo "\n"
release:
npm run release
release.master:
npm run release
git push --follow-tags origin master
release.dev:
npm run release
git push --follow-tags origin dev
deploy:
$(call deploy.help)
@echo "\n"
deploy.help:
$(call deploy.help)
@echo "\n"
deploy.dev:
./deploy/dev/packer.sh
git add .
git commit -am "build: development"
git push
@echo "------------------------------"
@echo "deploy to docker done!"
@echo "todo: restart docker container"
deploy.prod:
./deploy/production/packer.sh
git add .
git commit -am "build: production"
git push
@echo "------------------------------"
@echo "deploy to docker done!"
@echo "todo: restart docker container"
clean.cache:
rm -rf ./node_modules/.cache
test.help:
$(call test.help)
@echo "\n"
test:
npm run test
test.e2e:
npm run test:e2e
test.dev:
npm run test:dev
test.watch:
npm run test:watch
test.coverage:
npm run test:cover
test.report.text:
npm run test:cover
# lint code
lint.help:
$(call lint.help)
@echo "\n"
lint:
npm run lint
lint.watch:
npm run lint:watch # use dialyzer
# dashboard
dashboard.help:
$(call dashboard.help)
@echo "\n"
dashboard:
$(call dashboard.help)
@echo "\n"
dashboard.ga:
$(call browse,"$(DASHBOARD_GA_LINK)")
dashboard.apollo:
$(call browse,"$(DASHBOARD_APOLLO_LINK)")
dashboard.pm2:
$(call browse,"$(DASHBOARD_PM2_LINK)")
dashboard.errors:
$(call browse,"$(DASHBOARD_SENTRY_LINK)")
dashboard.aliyun:
$(call browse,"$(DASHBOARD_ALIYUN_LINK)")
# ci helpers
ci.help:
$(call ci.help)
@echo "\n"
ci:
$(call ci.help)
@echo "\n"
ci.build:
$(call browse,"$(CI_BUILD_LINK)")
ci.coverage:
$(call browse,"$(CI_COVERAGE_LINK)")
ci.codecov:
$(call browse,"$(CI_CODECOV_LINK)")
ci.codefactor:
$(call browse,"$(CI_CODEFACTOR_LINK)")
ci.codacy:
$(call browse,"$(CI_CODACY_LINK)")
ci.doc:
$(call browse,"$(CI_DOC_LINK)")
ci.depsbot:
$(call browse,"$(CI_DEPSBOT_LINK)")
# github helpers
github:
$(call github.help)
@echo "\n"
github.help:
$(call github.help)
@echo "\n"
github.code:
$(call browse,"$(GITHUB_CODE_LINK)")
github.doc:
$(call browse,"$(GITHUB_DOC_LINK)")
github.pr:
$(call browse,"$(GITHUB_PR_LINK)")
github.issue:
$(call browse,"$(GITHUB_ISSUE_LINK)")
github.issue.new:
$(call browse,"$(GITHUB_ISSUE_LINK)/new")
github.app:
$(call browse,"$(GITHUB_APP_LINK)")