This repository has been archived by the owner on Nov 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
229 lines (189 loc) · 5.86 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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
AM_TYPES_BIN = node_modules/asyncmachine/bin/am-types.js
SHOWDOWN_BIN = node_modules/showdown/bin/showdown.js
compile:
node_modules/.bin/tsc --pretty --noEmit
compile-watch:
node_modules/.bin/tsc --pretty --watch --noEmit
clean-www-cache:
rm -rf www/node_modules/.cache/babel-loader/*
build:
-node_modules/.bin/tsc
make build-www
build-www:
make clean-www-cache
cd www && NODE_ENV=production node_modules/.bin/next build
build-watch:
node_modules/.bin/tsc --watch
start:
DEBUG_FILE=1 \
DEBUG=root:\*-info,\*-error,app-info \
node src/app/bootstrap.js
start-production-env:
# forcing production
NODE_ENV=production TB_ENV=production \
DEBUG_FILE=1 \
DEBUG=root:\*-info,\*-error,app-info \
node src/app/bootstrap.js
start-staging-env:
# forcing staging
NODE_ENV=production TB_ENV=staging \
DEBUG_FILE=1 \
DEBUG=root:\*-info,\*-error,app-info \
node src/app/bootstrap.js
start-am:
DEBUG=\*-error,connections-verbose,record-diff-verbose,root:\*-info,gmail-root,gtasks-root,\*inbox-labels\*,\*task-labels\*,\*gmail\*pending\*,\*next\*,\*-am \
DEBUG_FILE=1 \
DEBUG_AM=1 \
node --inspect \
src/app/bootstrap.js
start-verbose:
DEBUG=\*-error,\*-verbose,root:\*-info,gmail-root,gtasks-root,record-diff-verbose \
DEBUG_FILE=1 \
DEBUG_AM=1 \
node --inspect \
src/app/bootstrap.js
start-ami:
DEBUG=root:\*-info,gmail-root,gtasks DEBUG_FILE=1 DEBUG_AMI=1 DEBUG_AM=1 \
node --inspect src/app/bootstrap.js
#node --inspect-brk src/app/bootstrap.js
start-inspect:
DEBUG=root node --inspect src/app/bootstrap.js
start-am-heartbeat:
@echo 'Start with expressive logging for HeartBeat with the --inspect flag'
# connections-verbose,
DEBUG=root\*,gmail-root,gtasks-root,\*-am,\*-error,gmail-query-next\* \
DEBUG_FILE=1 \
DEBUG_AM=3 \
node --inspect src/app/bootstrap.js
#node --inspect-brk src/app/bootstrap.js
start-www:
cd www && npm run dev
clear-logs:
rm logs/*
site:
$(SHOWDOWN_BIN) makehtml \
-i static/privacy-policy.md -o static/privacy-policy-output.html
deploy-production:
# TODO switch to the correct project
make build-www
gcloud app deploy production.yaml --version=production
# sudo docker exec -t -i gaeapp /bin/bash
# sudo apt-get install mc fish htop
# kill -HUP 1
deploy-staging:
# TODO switch to the correct project
make build-www
gcloud app deploy staging.yaml --version=staging
# sudo docker exec -t -i gaeapp /bin/bash
# sudo apt-get install mc fish htop
# kill -HUP 1
debug:
DEBUG=root DEBUG_FILE=1 node --inspect-brk src/app/bootstrap.js
debug-list-next:
DEBUG=google\*-info,gmail-root\*-info,gtasks-root\*-info,gmail-query-next\*,gmail-list-next\*,gtasks-list-next\*,\*-error,record-diff-verbose \
DEBUG_FILE=1 \
DEBUG_AM=1 \
node --inspect src/app/bootstrap.js
#node --inspect-brk src/app/bootstrap.js
debug-gmail:
DEBUG=record-diff-verbose,google,gmail-root,gmail-verbose,\*-error,gtasks \
DEBUG_FILE=1 \
DEBUG_AM=1 \
node --inspect src/app/bootstrap.js
format:
prettier --config package.json --write *.ts
prettier --config package.json --write src/*.ts
prettier --config package.json --write src/**/*.ts
prettier --config package.json --write src/**/**/*.ts
am-types:
mkdir -p typings/machines/sync
mkdir -p typings/machines/google/gmail
mkdir -p typings/machines/google/tasks
$(AM_TYPES_BIN) src/sync/reader.js -e sync_reader_state \
-o typings/machines/sync/reader.ts
$(AM_TYPES_BIN) src/sync/writer.js -e sync_writer_state \
-o typings/machines/sync/writer.ts
$(AM_TYPES_BIN) src/sync/root.js -e sync_state \
-o typings/machines/sync/root.ts
$(AM_TYPES_BIN) src/google/sync.js -e sync_state \
-o typings/machines/google/sync.ts
$(AM_TYPES_BIN) src/google/auth.json \
-o typings/machines/google/auth.ts
$(AM_TYPES_BIN) src/google/tasks/sync.js -e sync_state \
-o typings/machines/google/tasks/sync.ts
$(AM_TYPES_BIN) src/google/tasks/sync-list.js -e sync_state \
-o typings/machines/google/tasks/sync-list.ts
$(AM_TYPES_BIN) src/google/gmail/sync-list.js -e sync_state \
-o typings/machines/google/gmail/sync-list.ts
$(AM_TYPES_BIN) src/google/gmail/sync.js -e sync_state \
-o typings/machines/google/gmail/sync.ts
$(AM_TYPES_BIN) src/google/gmail/query.js -e sync_state \
-o typings/machines/google/gmail/query.ts
npmi:
npm i
npm link asyncmachine
npm link ami-logger
test:
-SCENARIO=0 npx jest gmail
sleep 30
-SCENARIO=1 npx jest gmail
sleep 30
-SCENARIO=2 npx jest gmail
sleep 30
-SCENARIO=0 npx jest gtasks
sleep 30
-SCENARIO=1 npx jest gtasks
sleep 30
-SCENARIO=2 npx jest gtasks
sleep 30
-SCENARIO=0 npx jest sync
sleep 5
-SCENARIO=1 npx jest sync
sleep 5
-SCENARIO=2 npx jest sync
test-mocks:
SCENARIO=0 \
DEBUG=tests,google\*-info,gmail-root\*-info,gtasks-root\*-info,gmail-query-next\*,gmail-list-next\*,gtasks-list-next\*,\*-error,db\*,label-filter-\*,\*inbox-labels\*,root:\* \
DEBUG_FILE=1 \
DEBUG_AM=1 \
node \
./node_modules/jest/bin/jest.js \
mocks
test-gtasks-mocked:
DEBUG=mock-\*,gmail-list-next:\*,gtasks-list-next:\*,test,root:\*-verbose,record-diff\*,db-verbose \
MOCK=true \
npx jest \
gtasks
test-gmail-mocked:
DEBUG=root:\*-info,\*-error,app-info,\*-am,gmail-\*,mock-\* \
MOCK=true \
npx jest \
gmail
test-sync-mocked:
DEBUG=mock-gmail\*,gmail-list-next:\*,gtasks-list-next:\*,test,root:\*-verbose,record-diff\*,db-verbose \
MOCK=true \
npx jest \
sync
test-sync:
DEBUG=mock-gmail\*,gmail-list-next:\*,gtasks-list-next:\*,test,root:\*-verbose,record-diff\*,db-verbose \
npx jest \
sync
test-gmail:
DEBUG=root:\*-info,\*-error,app-info,\*-am,gmail-\*,mock-\* \
npx jest \
gmail
test-gtasks:
DEBUG=mock-gmail\*,gmail-list-next:\*,gtasks-list-next:\*,test,root:\*-verbose,record-diff\*,db-verbose \
npx jest \
gtasks
test-mocked-default:
MOCK=true \
npx jest
test-mocked:
-SCENARIO=0 MOCK=true \
npx jest
-SCENARIO=1 MOCK=true \
npx jest
-SCENARIO=2 MOCK=true \
npx jest
.PHONY: test break build