-
Notifications
You must be signed in to change notification settings - Fork 0
/
justfile
97 lines (73 loc) · 2.4 KB
/
justfile
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
rust-dev-name := "ghcr.io/manhunto/webhooks-rs-dev"
rust-dev-version := "latest"
rust-dev-image := rust-dev-name + ":" + rust-dev-version
rabbitmq-dev-name := "ghcr.io/manhunto/webhooks-rs-rabbitmq"
rabbitmq-dev-version := "latest"
rabbitmq-dev-image := rabbitmq-dev-name + ":" + rabbitmq-dev-version
alias b := build
alias f := format
alias fmt := format
alias c := clippy
alias t := test
alias rs := run-server
alias rd := run-dispatcher
alias rps := run-producer-server
alias rds := run-destination-server
alias du := docker-up
alias dd := docker-down
alias rdb := rust-dev-build
alias rdp := rust-dev-push
default:
@just --list
build *OPTIONS:
cargo build --all-targets --workspace {{ OPTIONS }}
format:
cargo fmt --all
# Run main server
run-server *OPTIONS:
cargo run --package=server {{ OPTIONS }}
# Run consumer that sends messages to destination servers
run-dispatcher *OPTIONS:
cargo run --package=server --bin=dispatcher {{ OPTIONS }}
# Run example server that produces messages
run-producer-server *OPTIONS:
cargo run --example producer-server {{ OPTIONS }}
# Run example server that listens for messages and act like real server (with random response delay)
run-destination-server *OPTIONS:
cargo run --example destination-server {{ OPTIONS }}
# Run cli with args
run-cli *ARGS:
cargo run --package=cli -- {{ ARGS }}
test:
cargo test --workspace
clippy:
cargo clippy --all-targets --all-features -- -D warnings
clippy-pedantic:
cargo clippy --all-targets --all-features -- -D warnings -W clippy::pedantic
udeps:
cargo +nightly udeps --all-targets
coverage:
cargo +nightly-2024-05-18 tarpaulin --all-features --workspace --ignore-tests --timeout 120
docker-up *OPTIONS:
docker compose --env-file=.env up {{ OPTIONS }}
docker-down:
docker compose down --remove-orphans
check:
just build
cargo fmt --check --all
just clippy
just test
cargo sort --workspace
init:
just docker-up --detach
./scripts/init-db.sh
rust-dev-build:
docker build --platform linux/amd64 . -t {{ rust-dev-image }} -f .docker/rust/Dockerfile
rust-dev-push:
docker push {{ rust-dev-image }}
rabbitmq-dev-build:
docker build --platform linux/amd64 . -t {{ rabbitmq-dev-image }} -f .docker/rabbitmq/Dockerfile
rabbitmq-dev-push:
docker push {{ rabbitmq-dev-image }}
create-migration NAME:
sqlx migrate add --source=server/migrations "{{ NAME }}"