-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.sh
executable file
·55 lines (54 loc) · 1.42 KB
/
setup.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
#!/bin/bash
#./setup.sh all / cp / wrk / del / del wrk /
if [ $# -eq 0 ]
then
echo "No arguments supplied"
else
source ./configure/functions/utility.sh
INPUT=""
for i
do
INPUT+=$i" "
done
INPUT=$(echo $INPUT | xargs)
validateInput INPUT
printf "#!/bin/bash\n\n" > ./run.sh
printf "source ./configure/functions/utility.sh\n" > ./run.sh
sudo chmod +x ./run.sh
parse_yaml k8s-config.yaml >> ./run.sh
printf "validate_yaml_input\n" >> ./run.sh
if [[ $1 == del ]]
then
if [ -z "$2" ]
then
printf "./destroy.sh \$k8s_provider\n" >> ./run.sh
# elif [[ $2 == wrk ]]
# then
# printf "./destroy.sh \$k8s_provider wrk\n" >> ./run.sh
fi
elif [[ $1 == all ]]
then
printf "./setup_start.sh\n" >> ./run.sh
printf "./setup_cp.sh\n" >> ./run.sh
printf "./setup_end.sh\n" >> ./run.sh
printf "./setup_nd.sh\n" >> ./run.sh
elif [[ $1 == cp ]]
then
printf "./setup_start.sh\n" >> ./run.sh
printf "./setup_cp.sh\n" >> ./run.sh
printf "./setup_end.sh\n" >> ./run.sh
elif [[ $1 == scale ]]
then
if [ -z "$2" ]
then
printf "./setup_nd.sh\n" >> ./run.sh
fi
elif [[ $1 == make ]]
then
printf "./make.sh" >> ./run.sh
elif [[ $1 == build ]]
then
printf "scripts/build-k8s.sh" >> ./run.sh
fi
./run.sh
fi