-
Notifications
You must be signed in to change notification settings - Fork 33
/
gather_config
39 lines (33 loc) · 1.14 KB
/
gather_config
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
extra_args=''
export relpath="../../"
if [[ "${1}" == "-k" ]] ||
[[ "${1}" == "k8s" ]] ||
[[ "${1}" == "kubernetes" ]]; then
shift
export CLUSTER="kubernetes"
else
export CLUSTER="openshift"
fi
if [[ "$(pwd)" == *"ec2"* ]]; then
source "${relpath}config/ec2_env_vars"
elif [ "$(pwd | awk -F '/' '{ print $NF }')" == "mac" ]; then
source ${relpath}config/mac_env_vars
extra_args+=" -e @${relpath}config/local_vars.yml"
extra_args+=" -e @${relpath}config/mac_vars.yml"
elif [ "$(pwd | awk -F '/' '{ print $NF }')" == "linux" ]; then
source ${relpath}config/linux_env_vars
extra_args+=" -e @${relpath}config/local_vars.yml"
elif [ "$(pwd | awk -F '/' '{ print $NF }')" == "gate" ]; then
source ${relpath}config/linux_env_vars
extra_args+=" -e @${relpath}config/gating_vars.yml"
extra_args+=" -e @${relpath}config/local_vars.yml"
fi
if echo "$0" | grep -q reset; then
extra_args+=" -e @${relpath}config/reset_vars.yml"
fi
if [ "$1" == "--rcm" ]; then
shift
extra_args+=" -e @${relpath}config/rcm_vars.yml"
fi
[[ ! -e ${relpath}config/my_vars.yml ]] || extra_args+=" -e @${relpath}config/my_vars.yml"
ANS_CODE="${relpath}ansible"