-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathMakefile
More file actions
52 lines (41 loc) · 1.67 KB
/
Makefile
File metadata and controls
52 lines (41 loc) · 1.67 KB
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
SHELL := /bin/bash
LATEST_TAG := $(shell git describe --abbrev=0 --tags $(git rev-list --tags --max-count=1))
define bundle_release
@echo ""
if [[ "$(1)" == *"windows"* ]]; then \
tar -czvf ./target/$(1)/release/kubesess_$(1).tar.gz ./target/$(1)/release/kubesess.exe; \
else \
tar -czvf ./target/$(1)/release/kubesess_$(1).tar.gz ./target/$(1)/release/kubesess; \
fi
endef
.PHONY: run
run:
cargo run -- -v docker-desktop context
.PHONY: build
build:
cargo build --release
.PHONY: clean
clean:
rm -r -f $$HOME/.kube/kubesess
sudo rm -r -f /usr/local/bin/kubesess
.PHONY: bundle_release
bundle_release:
$(call bundle_release,${TARGET})
.PHONY: deploy_local
deploy_local: clean build
mkdir -p $$HOME/.kube/kubesess
sudo cp ./target/release/kubesess /usr/local/bin/kubesess
@echo ""
@echo "Installation complete. Add the following to your shell config:"
@echo " For bash/zsh: eval \"\$$(kubesess init bash)\""
@echo " For fish: kubesess init fish | source"
@echo " For pwsh: Invoke-Expression (&kubesess init powershell)"
.PHONY: benchmark
benchmark: deploy_local
sh ./benches/benchmark.sh
hyperfine --warmup 5 --runs 10 --shell none 'kubesess -v docker-desktop context' 'kubectx docker-desktop' --export-markdown ./benches/hyperfine/context-markdown-kubectx.md
hyperfine --warmup 5 --runs 10 --shell none 'kubesess -v docker-desktop context' 'kubie ctx docker-desktop' --export-markdown ./benches/hyperfine/context-markdown-kubie.md
.PHONY: benchmark-ns
benchmark-ns: deploy_local
sh ./benches/benchmark.sh
hyperfine --warmup 5 --runs 10 --shell none 'kubesess -v monitoring namespace' 'kubens monitoring' --export-markdown ./benches/hyperfine/namespace-markdown.md