-
Notifications
You must be signed in to change notification settings - Fork 157
/
Copy pathopenshift-ci-tests.sh
executable file
·81 lines (70 loc) · 1.54 KB
/
openshift-ci-tests.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
#!/bin/bash
set -e
export PS4='[$(date "+%Y-%m-%d %H:%M:%S")] ' # logs timestamp for every cmd.
# Define log file names and directories.
LOGFILE="test-log"
export DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
OVERALL_RESULT=0
# Define a cleanup function to be executed upon script exit.
# shellcheck disable=SC2317
cleanup() {
echo "Cleaning up before exiting"
if [[ "${OPENSHIFT_CI}" == "true" ]]; then
case "$JOB_NAME" in
*gke*)
echo "Calling cleanup_gke"
cleanup_gke
;;
esac
fi
rm -rf ~/tmpbin
}
trap cleanup EXIT INT ERR
SCRIPTS=(
"env_variables.sh"
"utils.sh"
"jobs/aks.sh"
"jobs/gke.sh"
"jobs/main.sh"
"jobs/operator.sh"
"jobs/periodic.sh"
"jobs/auth-providers.sh"
)
# Source each script dynamically
for SCRIPT in "${SCRIPTS[@]}"; do
source "${DIR}/${SCRIPT}"
echo "Loaded ${SCRIPT}"
done
main() {
echo "Log file: ${LOGFILE}"
echo "JOB_NAME : $JOB_NAME"
case "$JOB_NAME" in
*aks*)
echo "Calling handle_aks"
handle_aks
;;
*e2e-tests-nightly-auth-providers)
echo "Calling handle_auth_providers"
handle_auth_providers
;;
*gke*)
echo "Calling handle_gke"
handle_gke
;;
*operator*)
echo "Calling Operator"
handle_operator
;;
*nightly*)
echo "Calling handle_periodic"
handle_nightly
;;
*pull*)
echo "Calling handle_main"
handle_main
;;
esac
echo "Main script completed with result: ${OVERALL_RESULT}"
exit "${OVERALL_RESULT}"
}
main