-
Notifications
You must be signed in to change notification settings - Fork 84
/
.test.sh
50 lines (40 loc) · 686 Bytes
/
.test.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
#!/usr/bin/env bash
trap "exit 1" TERM
export TOP_PID=$$
export project_name="kopf-$(date +'%d%m%Y')"
install() {
echo "install - $(pwd)"
oc new-project ${project_name}
helm install kopf .
}
test() {
echo "test - $(pwd)"
for i in clusterkopfpeerings.kopf.dev kopfpeerings.kopf.dev; do
oc get crd $i
if [[ $? != 0 ]]; then
echo "CRD: $i not present"
exit 1
fi
done
echo "Test complete"
}
cleanup() {
echo "cleanup - $(pwd)"
helm uninstall kopf
oc delete project/${project_name}
}
# Process arguments
case $1 in
install)
install
;;
test)
test
;;
cleanup)
cleanup
;;
*)
echo "Not an option"
exit 1
esac