-
Notifications
You must be signed in to change notification settings - Fork 281
/
Copy pathtest.sh
executable file
·36 lines (32 loc) · 1019 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
#!/bin/bash
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
pushd $SCRIPT_DIR/../..
make cert-manager
popd
cat <<EOF | kubectl apply -f -
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: selfsigned-issuer
spec:
selfSigned: {}
EOF
set -e
## Removing stale namespace. Most likely due to previous test failures
kubectl delete namespaces examples --ignore-not-found --timeout=5m
for example in $(find "$SCRIPT_DIR" -mindepth 1 -type d)
do
[[ -e "$example"/.ci-skip ]] && continue
pushd "$example"
kubectl create namespace examples
kubectl config set-context --current --namespace=examples
[[ -e setup.sh ]] && ./setup.sh
kubectl apply -f rabbitmq.yaml --timeout=30s
kubectl wait -f rabbitmq.yaml --for=condition=AllReplicasReady --timeout=5m
kubectl wait -f rabbitmq.yaml --for=condition=ReconcileSuccess --timeout=5m
./test.sh
## Teardown
kubectl delete -f rabbitmq.yaml --timeout=3m
kubectl delete namespace examples --timeout=10m
popd
done