-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
56 lines (43 loc) · 1.73 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
# Default make command
build: genpb gensw buildrs fmt lint
# Build Rust code
buildrs:
cargo build
# Format all
fmt: fmtproto fmtrs
# Format proto files
fmtproto:
clang-format -i proto/exchange/matchengine.proto proto/rollup/rollup.proto
# Format Rust code
fmtrs:
cargo fmt --all
# Generate PB files
genpb:
cd proto && protoc -Ithird_party/googleapis -I. --include_imports --include_source_info --descriptor_set_out=exchange/matchengine.pb exchange/matchengine.proto
cd proto && protoc -Ithird_party/googleapis -I. --include_imports --include_source_info --descriptor_set_out=rollup/rollup.pb rollup/rollup.proto
# Generate Swagger JSON files
gensw: goinstall
protoc -I. -Iproto/third_party/googleapis --openapiv2_out . --openapiv2_opt logtostderr=true proto/exchange/matchengine.proto
protoc -I. -Iproto/third_party/googleapis --openapiv2_out . --openapiv2_opt logtostderr=true proto/rollup/rollup.proto
# Install go dependencies
goinstall:
go mod tidy
bash go-install.sh
# Lint all
lint: lintrs
# Lint Rust code
lintrs:
cargo fmt --all -- --check
cargo clippy -- -D warnings
# Start docker-compose for fluidex-backend
runbe: stopbe
docker-compose --file docker/docker-compose.yaml --project-name fluidex-backend up --force-recreate # --detach
# Start docker-compose for Swagger UI
runswui: stopswui
docker-compose --file docker/docker-compose-swagger-ui.yaml --project-name fluidex-swagger-ui up --force-recreate # --detach
# Stop docker-compose for fluidex-backend
stopbe:
docker-compose --file docker/docker-compose.yaml --project-name fluidex-backend down --remove-orphans
# Stop docker-compose for Swagger UI
stopswui:
docker-compose --file docker/docker-compose-swagger-ui.yaml --project-name fluidex-swagger-ui down --remove-orphans