forked from GaloyMoney/blink
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
166 lines (121 loc) · 4.84 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
BIN_DIR=node_modules/.bin
start-deps:
docker compose up bats-deps -d
start-deps-integration:
docker compose up integration-deps -d
update-price-history:
docker compose run price-history node servers/history/cron.js
start-main:
. ./.env && yarn tsnd --respawn --files -r tsconfig-paths/register -r src/services/tracing.ts \
src/servers/graphql-main-server.ts | yarn pino-pretty -c -l
start-main-fast:
yarn run watch-main | yarn pino-pretty -c -l
start-trigger:
. ./.env && yarn tsnd --respawn --files -r tsconfig-paths/register -r src/services/tracing.ts \
src/servers/trigger.ts | yarn pino-pretty -c -l
start-cron: start-deps
. ./.env && yarn tsnd --files -r tsconfig-paths/register -r src/services/tracing.ts \
src/servers/cron.ts | yarn pino-pretty -c -l
start-ws:
. ./.env && yarn tsnd --respawn --files -r tsconfig-paths/register -r src/services/tracing.ts \
src/servers/ws-server.ts | yarn pino-pretty -c -l
start-ibex-wh:
. ./.env && yarn tsnd --respawn --files -r tsconfig-paths/register -r src/services/tracing.ts \
src/servers/ibex-webhook-server.ts | yarn pino-pretty -c -l
start-loopd:
./dev/bin/start-loopd.sh
start: start-deps
make start-main & make start-trigger & make start-ws & make start-ibex-wh
start-main-ci:
node lib/servers/graphql-main-server.js
start-trigger-ci:
node lib/servers/trigger.js
start-ws-ci:
node lib/servers/ws-server.js
exporter: start-deps
. ./.env && yarn tsnd --respawn --files -r tsconfig-paths/register -r src/services/tracing.ts \
src/servers/exporter.ts | yarn pino-pretty -c -l
watch:
yarn nodemon -V -e ts,graphql -w ./src -x make start
clean-deps:
docker compose down -t 3
reset-deps: clean-deps start-deps
reset-deps-integration: clean-deps start-deps-integration
test: unit legacy-integration integration
test-migrate:
docker compose down -v -t 3
docker compose build
docker compose -f docker-compose.yml up mongodb-migrate --exit-code-from mongodb-migrate
unit:
yarn test:unit
watch-unit:
$(BIN_DIR)/jest --config ./test/flash/unit/jest.config.js --clearCache
NODE_ENV=test LOGLEVEL=warn $(BIN_DIR)/jest --watch --config ./test/flash/unit/jest.config.js
watch-compile:
$(BIN_DIR)/tsc --watch --noEmit
del-containers:
docker compose rm -sfv
legacy-integration:
yarn build && \
yarn test:legacy-integration
reset-legacy-integration: reset-deps-integration legacy-integration
integration:
yarn build && \
yarn test:integration
reset-integration: reset-deps-integration integration
bats:
yarn build && \
bats -t test/bats
reset-bats: reset-deps bats
execute-bats-from-within-container:
git config --global --add safe.directory /repo # otherwise bats complains
yarn install && \
yarn build && \
bats -t test/bats
integration-in-ci:
make create-tmp-env-ci && \
TMP_ENV_CI=tmp.env.ci docker compose -f docker-compose.yml up integration-tests --attach integration-tests
# NODE_OPTIONS line should be removed whenever we upgrade yarn.lock to see if
# heap allocation issue has been resolved in dependencies (fails at 2048).
execute-integration-from-within-container:
yarn install && \
SVIX_ENDPOINT= \
SVIX_SECRET= \
NODE_OPTIONS="--max-old-space-size=6144" \
NODE_ENV=test LOGLEVEL=error $(BIN_DIR)/jest --config ./test/flash/legacy-integration/jest.config.js --bail --runInBand --ci --reporters=default --reporters=jest-junit && \
NODE_OPTIONS="--max-old-space-size=6144" \
NODE_ENV=test LOGLEVEL=error $(BIN_DIR)/jest --config ./test/flash/integration/jest.config.js --bail --runInBand --ci --reporters=default --reporters=jest-junit
unit-in-ci:
. ./.env && \
LOGLEVEL=warn $(BIN_DIR)/jest --config ./test/flash/unit/jest.config.js --ci --bail --maxWorkers=50%
check-implicit:
yarn tsc-check-noimplicitany
check-code: check-implicit
yarn tsc-check
yarn eslint-check
yarn build
yarn check:sdl
yarn check-yaml
yarn madge-check
create-tmp-env-ci:
. ./.env && \
envsubst < .env.ci > tmp.env.ci
# 16 is exit code for critical https://classic.yarnpkg.com/lang/en/docs/cli/audit
audit:
bash -c 'yarn audit --level critical; [[ $$? -ge 16 ]] && exit 1 || exit 0'
mine-block:
container_id=$$(docker ps -q -f status=running -f name="bitcoind-1"); \
docker exec -it "$$container_id" /bin/sh -c 'bitcoin-cli createwallet -chain=regtest || ADDR=$$(bitcoin-cli getnewaddress "") && bitcoin-cli generatetoaddress 6 $$ADDR '
lncli-1:
docker exec -it $$(docker ps -q -f status=running -f name="lnd1-1") /bin/sh -c 'lncli -n regtest ${command}'
# to pay an invoice: make lncli-outside-1 command="payinvoice lnbcrt1... --amt=100 -f"
lncli-outside-1:
docker exec -it $$(docker ps -q -f status=running -f name="lnd-outside-1-1") /bin/sh -c 'lncli -n regtest ${command}'
kill-graphql:
kill $$(lsof -t -i:4001) & kill $$(lsof -t -i:4012) & kill $$(lsof -t -i:4000) & kill $$(lsof -t -i:8888)
redis-cli:
docker-compose exec redis redis-cli
codegen:
. ./.env && yarn write-sdl
gen-test-jwt:
yarn gen-test-jwt