This repository has been archived by the owner on Jun 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Makefile
209 lines (163 loc) · 7.33 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
.PHONY: clean coldstart mrproper up build logs
all: build up
compose := docker-compose
up:
$(compose) up -d
down:
$(compose) down --volumes --remove-orphans
start:
$(compose) start
stop:
$(compose) stop
restart:
$(compose) restart
backup-db:
$(compose) exec -T mysql-primary mysqldump --set-gtid-purged=OFF --no-create-db lisk -u root -ppassword > mysql_indexer_index.sql
restore-db:
$(compose) exec -T mysql-primary mysql lisk -u root -ppassword < mysql_indexer_index.sql
flush-db:
echo "DROP DATABASE lisk; CREATE DATABASE lisk;" | $(compose) exec -T mysql-primary mysql -u root -ppassword
stop-%:
$(compose) stop $*
start-%:
$(compose) start $*
ready:
$(compose) exec -T tests curl --silent --fail 'http://gateway:9901/api/ready' >/dev/null
test: test-functional
test-functional:
$(compose) exec -T tests yarn run test:functional
test-integration:
$(compose) exec -T tests yarn run test:integration:APIv3
cli: cli-gateway
cli-%:
$(compose) exec $* /bin/sh
mysql-%:
$(compose) exec mysql_$* mysql -u root -ppassword lisk
redis-%:
$(compose) exec redis_$* redis-cli
logs:
$(compose) logs
logs-live:
$(compose) logs --follow
logs-%:
$(compose) logs $*
logs-live-%:
$(compose) logs $* --follow
print-config:
$(compose) config
build: build-local build-images
build-images: build-app-registry build-connector build-indexer build-coordinator build-statistics build-fees build-market build-export build-gateway
build-all: build build-template build-tests
build-app-registry:
cd ./services/blockchain-app-registry && docker buildx build --build-arg NODEJS_VERSION=$(shell cat .nvmrc) --tag=lisk/service_blockchain_app_registry ./
build-connector:
cd ./services/blockchain-connector && docker buildx build --build-arg NODEJS_VERSION=$(shell cat .nvmrc) --tag=lisk/service_blockchain_connector ./
build-indexer:
cd ./services/blockchain-indexer && docker buildx build --build-arg NODEJS_VERSION=$(shell cat .nvmrc) --tag=lisk/service_blockchain_indexer ./
build-coordinator:
cd ./services/blockchain-coordinator && docker buildx build --build-arg NODEJS_VERSION=$(shell cat .nvmrc) --tag=lisk/service_blockchain_coordinator ./
build-statistics:
cd ./services/transaction-statistics && docker buildx build --build-arg NODEJS_VERSION=$(shell cat .nvmrc) --tag=lisk/service_transaction_statistics ./
build-fees:
cd ./services/fee-estimator && docker buildx build --build-arg NODEJS_VERSION=$(shell cat .nvmrc) --tag=lisk/service_fee_estimator ./
build-market:
cd ./services/market && docker buildx build --build-arg NODEJS_VERSION=$(shell cat .nvmrc) --tag=lisk/service_market ./
build-export:
cd ./services/export && docker buildx build --build-arg NODEJS_VERSION=$(shell cat .nvmrc) --tag=lisk/service_export ./
build-gateway:
cd ./services/gateway && docker buildx build --build-arg NODEJS_VERSION=$(shell cat .nvmrc) --tag=lisk/service_gateway ./
build-template:
cd ./services/template && docker buildx build --build-arg NODEJS_VERSION=$(shell cat .nvmrc) --tag=lisk/service_template ./
build-tests:
cd ./tests && docker buildx build --build-arg NODEJS_VERSION=$(shell cat .nvmrc) --tag=lisk/service_tests ./
build-local:
yarn install --frozen-lockfile
cd ./framework && yarn install --frozen-lockfile
cd ./services/blockchain-app-registry && yarn install --frozen-lockfile
cd ./services/blockchain-connector && yarn install --frozen-lockfile
cd ./services/blockchain-coordinator && yarn install --frozen-lockfile
cd ./services/blockchain-indexer && yarn install --frozen-lockfile
cd ./services/transaction-statistics && yarn install --frozen-lockfile
cd ./services/fee-estimator && yarn install --frozen-lockfile
cd ./services/market && yarn install --frozen-lockfile
cd ./services/gateway && yarn install --frozen-lockfile
cd ./services/export && yarn install --frozen-lockfile
cd ./services/template && yarn install --frozen-lockfile
cd ./tests && yarn install --frozen-lockfile
clean: clean-local clean-images
clean-local:
rm -rf node_modules
cd ./framework && rm -rf node_modules
cd ./services/blockchain-app-registry && rm -rf node_modules
cd ./services/blockchain-connector && rm -rf node_modules
cd ./services/blockchain-coordinator && rm -rf node_modules
cd ./services/blockchain-indexer && rm -rf node_modules
cd ./services/transaction-statistics && rm -rf node_modules
cd ./services/fee-estimator && rm -rf node_modules
cd ./services/market && rm -rf node_modules
cd ./services/gateway && rm -rf node_modules
cd ./services/export && rm -rf node_modules
cd ./services/template && rm -rf node_modules
cd ./tests && rm -rf node_modules
clean-images:
docker rmi lisk/service_gateway \
lisk/service_blockchain_app_registry \
lisk/service_blockchain_connector \
lisk/service_blockchain_indexer \
lisk/service_blockchain_coordinator \
lisk/service_transaction_statistics \
lisk/service_fee_estimator \
lisk/service_market \
lisk/service_export \
lisk/service_template \
lisk/service_tests; :
audit:
yarn audit; :
cd ./framework && yarn audit; :
cd ./services/blockchain-app-registry && yarn audit; :
cd ./services/blockchain-connector && yarn audit; :
cd ./services/blockchain-coordinator && yarn audit; :
cd ./services/blockchain-indexer && yarn audit; :
cd ./services/transaction-statistics && yarn audit; :
cd ./services/fee-estimator && yarn audit; :
cd ./services/market && yarn audit; :
cd ./services/gateway && yarn audit; :
cd ./services/export && yarn audit; :
audit-fix:
yarn audit fix; :
cd ./framework && yarn audit fix; :
cd ./services/blockchain-app-registry && yarn audit fix; :
cd ./services/blockchain-connector && yarn audit fix; :
cd ./services/blockchain-coordinator && yarn audit fix; :
cd ./services/blockchain-indexer && yarn audit fix; :
cd ./services/transaction-statistics && yarn audit fix; :
cd ./services/fee-estimator && yarn audit fix; :
cd ./services/market && yarn audit fix; :
cd ./services/gateway && yarn audit fix; :
cd ./services/export && yarn audit fix; :
tag-%:
yarn version --no-git-tag-version --new-version $*
cd services/gateway && yarn version --no-git-tag-version --new-version $*
cd services/blockchain-app-registry && yarn version --no-git-tag-version --new-version $*
cd services/blockchain-connector && yarn version --no-git-tag-version --new-version $*
cd services/blockchain-coordinator && yarn version --no-git-tag-version --new-version $*
cd services/blockchain-indexer && yarn version --no-git-tag-version --new-version $*
cd services/transaction-statistics && yarn version --no-git-tag-version --new-version $*
cd services/fee-estimator && yarn version --no-git-tag-version --new-version $*
cd services/market && yarn version --no-git-tag-version --new-version $*
cd services/export && yarn version --no-git-tag-version --new-version $*
cd services/template && yarn version --no-git-tag-version --new-version $*
git add ./services/gateway/package.json
git add ./services/blockchain-app-registry/package.json
git add ./services/blockchain-connector/package.json
git add ./services/blockchain-coordinator/package.json
git add ./services/blockchain-indexer/package.json
git add ./services/transaction-statistics/package.json
git add ./services/fee-estimator/package.json
git add ./services/market/package.json
git add ./services/export/package.json
git add ./services/template/package.json
git add ./package.json
git commit -S -m ":arrow_up: Version bump to $*"
git tag v$*
mrproper: down clean