-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
32 lines (32 loc) · 1.6 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
build-release:
cargo build --release
benchmark-fishtank:
dnspyre -s "192.168.178.113:53" -c 4 -t A --recurse --no-color https://raw.githubusercontent.com/Tantalor93/dnspyre/master/data/1000-domains
benchmark-nixpi:
dnspyre -s "192.168.178.121:53" -c 4 -t A --recurse --no-color https://raw.githubusercontent.com/Tantalor93/dnspyre/master/data/1000-domains
benchmark-local:
dnspyre -s "127.0.0.1:53000" -c 4 -t A --recurse --no-color https://raw.githubusercontent.com/Tantalor93/dnspyre/master/data/1000-domains
benchmark-all: build-release
./benchmarks/run.sh
tidy:
cargo fmt && cargo clippy -- -D warnings
build-docker:
docker buildx build --no-cache -f Dockerfile -t dns-thingy:latest .
test:
cargo test --all-features --all-targets -- --nocapture
dev:
cargo watch -w crates -x "run --bin dns-block-tokio"
deploy-nixpi:
# Based on https://sebi.io/posts/2024-05-02-guide-cross-compiling-rust-from-macos-to-raspberry-pi-2024-apple-silicon/
cargo build --release -p dns-block-tokio --target=armv7-unknown-linux-musleabihf
rsync ./target/armv7-unknown-linux-musleabihf/release/dns-block-tokio nixpi:/root/.cargo/bin/dns-block-tokio
ssh nixpi "systemctl restart dns-thingy"
logs-nixpi:
ssh nixpi "journalctl -u dns-thingy -f"
deploy-fishtank:
# Based on https://betterprogramming.pub/cross-compiling-rust-from-mac-to-linux-7fad5a454ab1
cargo build --release -p dns-block-tokio --target=x86_64-unknown-linux-musl
rsync ./target/x86_64-unknown-linux-musl/release/dns-block-tokio fishtank:/root/.cargo/bin/dns-block-tokio
ssh fishtank "systemctl restart dns-thingy"
logs-fishtank:
ssh fishtank "journalctl -u dns-thingy -f"