forked from kubeshop/tracetest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
executable file
·99 lines (83 loc) · 1.44 KB
/
run.sh
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#!/bin/sh
set -e
opts="-f docker-compose.yaml -f examples/docker-compose.demo.yaml"
restart() {
make build-docker
docker compose $opts kill tracetest
docker compose $opts up -d tracetest
}
logs() {
docker compose $opts logs -f
}
logstt() {
docker compose $opts logs -f tracetest
}
ps() {
docker compose $opts ps
}
down() {
docker compose $opts down
}
up() {
make build-docker
docker compose $opts up -d --remove-orphans
}
test() {
echo "Running tests: "${TESTS[@]}
docker compose $opts -f local-config/docker-compose.testrunner.yaml build ${TESTS[@]}
docker compose $opts -f local-config/docker-compose.testrunner.yaml run ${TESTS[@]}
}
TESTS=()
CMD=()
while [[ $# -gt 0 ]]; do
case $1 in
cypress)
TESTS+=("cypress")
shift
;;
dogfood)
TESTS+=("dogfood")
shift
;;
up)
CMD+=("up")
shift
;;
down)
CMD+=("down")
shift
;;
test)
CMD+=("test")
shift
;;
logstt)
CMD+=("logstt")
shift
;;
logs)
CMD+=("logs")
shift
;;
ps)
CMD+=("ps")
shift
;;
restart)
CMD+=("restart")
shift
;;
*)
echo "Unknown option $1"
help_message
exit 1
;;
esac
done
if [ ${#CMD[@]} -eq 0 ]; then
echo "missing command. usage: ./run.sh [up|down|ps|logs|restart|test|dogfood|cypress]"
exit 1
fi
for cmd in "${CMD[@]}"; do
$cmd
done