-
Notifications
You must be signed in to change notification settings - Fork 28
/
justfile
60 lines (49 loc) · 1.55 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
[private]
default:
@just --list --unsorted
# install crd into the cluster
install-crd: generate
kubectl apply -f yaml/crd.yaml
generate:
cargo run --bin crdgen > yaml/crd.yaml
helm template charts/doc-controller > yaml/deployment.yaml
# run with opentelemetry
run-telemetry:
OPENTELEMETRY_ENDPOINT_URL=http://127.0.0.1:55680 RUST_LOG=info,kube=debug,controller=debug cargo run --features=telemetry
# run without opentelemetry
run:
RUST_LOG=info,kube=debug,controller=debug cargo run
# format with nightly rustfmt
fmt:
cargo +nightly fmt
# run unit tests
test-unit:
cargo test
# run integration tests
test-integration: install-crd
cargo test -- --ignored
# run telemetry tests
test-telemetry:
OPENTELEMETRY_ENDPOINT_URL=http://127.0.0.1:55680 cargo test --lib --all-features -- get_trace_id_returns_valid_traces --ignored
# compile for musl (for docker image)
compile features="":
#!/usr/bin/env bash
docker run --rm \
-v cargo-cache:/root/.cargo \
-v $PWD:/volume \
-w /volume \
-t clux/muslrust:stable \
cargo build --release --features={{features}} --bin controller
cp target/x86_64-unknown-linux-musl/release/controller .
[private]
_build features="":
just compile {{features}}
docker build -t clux/controller:local .
# docker build base
build-base: (_build "")
# docker build with telemetry
build-otel: (_build "telemetry")
# local helper for test-telemetry and run-telemetry
# forward grpc otel port from svc/promstack-tempo in monitoring
forward-tempo:
kubectl port-forward -n monitoring svc/promstack-tempo 55680:4317