forked from andrew-delph/MyDataStore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdev
executable file
·79 lines (75 loc) · 2.11 KB
/
dev
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
#!/bin/bash
# Exit on any error
set -e
# Check for required argument
if [ "$#" -lt 1 ]; then
echo "Usage: $0 <arg>"
exit 1
fi
# Choose the command based on the argument
case $1 in
dc)
tmuxinator start -p ./.tmuxinator/tmuxinator-dc.yaml
;;
dc!)
tmux kill-session -t dc_dev
;;
k8-init)
minikube delete && minikube start && minikube addons enable metrics-server
./dev k8-r
;;
k8-r)
kubectl delete -f ./operator/config/samples/ || true
./deploy_operator.sh
./deploy_k8.sh
;;
k8-operator)
./deploy_operator.sh
;;
k8)
tmuxinator start -p ./.tmuxinator/tmuxinator-k8.yaml
;;
k8!)
tmux kill-session -t k8_dev
;;
k8-e2e)
./e2e_k8.sh
;;
dc-e2e)
k6 run e2e/test.js
;;
test)
bazel test --execution_log_json_file=events.json $(bazel query 'kind(go_test, //...)' --output=label) --test_filter=$2 --test_arg=-test.short --test_summary=detailed --test_output=summary
;;
rtest)
## TODO implement --test_summary=none for ibazel
ibazel test $(bazel query 'kind(go_test, //...)' --output=label) --test_filter=$2
;;
deps)
./update_deps.sh
;;
dc-pprof)
go tool pprof -http=:6001 http://localhost:6060/debug/pprof/profile
# go tool pprof http://localhost:6060/debug/pprof/profile
;;
events)
jq -r 'select(.walltime | rtrimstr("s") | tonumber > 1) | "\(.walltime): \(.targetLabel)"' events.json
;;
scale)
if [ "$#" -ne 2 ]; then
echo "Usage: $0 <number_of_replicas>"
exit 1
fi
if ! [[ "$2" =~ ^[0-9]+$ ]]; then
echo "Error: The argument must be a positive integer."
exit 1
fi
# docker-compose up -d --scale store=$2 || true
# kubectl scale statefulset store --replicas=$2
kubectl patch mykeystore store --type=merge -p "{\"spec\":{\"size\":$2}}" || true
;;
*)
echo "Invalid argument."
exit 1
;;
esac