forked from kube-rs/kube
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Drop make for script running for just To follow conventions used in rest of org. Signed-off-by: clux <[email protected]> * Add convenience helper for bumping k8s version Signed-off-by: clux <[email protected]> * forgot to remove the file Signed-off-by: clux <[email protected]> * update devcontainer and have it include just Signed-off-by: clux <[email protected]> * maintain 1.56 until we bump msrv Signed-off-by: clux <[email protected]> * fix fmt Signed-off-by: clux <[email protected]> * Update justfile Co-authored-by: kazk <[email protected]> * Update .devcontainer/Dockerfile Co-authored-by: kazk <[email protected]> * try again to get syntax highlighting Signed-off-by: clux <[email protected]> Co-authored-by: kazk <[email protected]>
- Loading branch information
Showing
5 changed files
with
99 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
VERSION := `git rev-parse HEAD` | ||
|
||
default: | ||
@just --list --unsorted --color=always | rg -v " default" | ||
|
||
clippy: | ||
#rustup component add clippy --toolchain nightly | ||
cargo +nightly clippy --workspace | ||
cargo +nightly clippy --no-default-features --features=rustls-tls | ||
|
||
fmt: | ||
#rustup component add rustfmt --toolchain nightly | ||
rustfmt +nightly --edition 2021 $(find . -type f -iname *.rs) | ||
|
||
doc: | ||
RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --lib --workspace --features=derive,ws,oauth,jsonpatch,client,derive,runtime,admission,k8s-openapi/v1_23 --open | ||
|
||
# Unit tests | ||
test: | ||
cargo test --lib --all | ||
cargo test --doc --all | ||
cargo test -p kube-examples --examples | ||
cargo test -p kube --lib --no-default-features --features=rustls-tls,ws,oauth | ||
cargo test -p kube --lib --no-default-features --features=native-tls,ws,oauth | ||
cargo test -p kube --lib --no-default-features --features=openssl-tls,ws,oauth | ||
cargo test -p kube --lib --no-default-features | ||
|
||
test-integration: | ||
kubectl delete pod -lapp=kube-rs-test | ||
cargo test --lib --all -- --ignored # also run tests that fail on github actions | ||
cargo test -p kube --lib --features=derive,runtime -- --ignored | ||
cargo test -p kube-client --lib --features=rustls-tls,ws -- --ignored | ||
cargo run -p kube-examples --example crd_derive | ||
cargo run -p kube-examples --example crd_api | ||
|
||
coverage: | ||
cargo tarpaulin --out=Html --output-dir=. | ||
#xdg-open tarpaulin-report.html | ||
|
||
deny: | ||
# might require rm Cargo.lock first to match CI | ||
cargo deny --workspace --all-features check bans licenses sources | ||
|
||
readme: | ||
rustdoc README.md --test --edition=2021 | ||
|
||
e2e: dapp | ||
ls -lah e2e/ | ||
docker build -t clux/kube-dapp:{{VERSION}} e2e/ | ||
k3d image import clux/kube-dapp:{{VERSION}} --cluster main | ||
sed -i 's/latest/{{VERSION}}/g' e2e/deployment.yaml | ||
kubectl apply -f e2e/deployment.yaml | ||
sed -i 's/{{VERSION}}/latest/g' e2e/deployment.yaml | ||
kubectl get all -n apps | ||
kubectl describe jobs/dapp -n apps | ||
kubectl wait --for=condition=complete job/dapp -n apps --timeout=50s || kubectl logs -f job/dapp -n apps | ||
kubectl get all -n apps | ||
kubectl wait --for=condition=complete job/dapp -n apps --timeout=10s || kubectl get pods -n apps | grep dapp | grep Completed | ||
|
||
dapp: | ||
#!/usr/bin/env bash | ||
docker run \ | ||
-v cargo-cache:/root/.cargo/registry \ | ||
-v "$PWD:/volume" -w /volume \ | ||
--rm -it clux/muslrust:stable cargo build --release -p e2e | ||
cp target/x86_64-unknown-linux-musl/release/dapp e2e/dapp | ||
chmod +x e2e/dapp | ||
|
||
k3d: | ||
k3d cluster create main --servers 1 --agents 1 --registry-create main \ | ||
--k3s-arg "--no-deploy=traefik@server:*" \ | ||
--k3s-arg '--kubelet-arg=eviction-hard=imagefs.available<1%,nodefs.available<1%@agent:*' \ | ||
--k3s-arg '--kubelet-arg=eviction-minimum-reclaim=imagefs.available=1%,nodefs.available=1%@agent:*' | ||
|
||
bump-k8s: | ||
#!/usr/bin/env bash | ||
current=$(cargo tree --format "{f}" -i k8s-openapi | head -n 1) | ||
next=${current::-2}$((${current:3} + 1)) | ||
fastmod -m -d . --extensions toml "$current" "$next" | ||
fastmod -m README.md "$current" "$next" | ||
|
||
# mode: makefile | ||
# End: | ||
# vim: set ft=make : |