-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.sh
executable file
·75 lines (68 loc) · 2.67 KB
/
start.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
#!/bin/bash
# cat ../../../code/prometheus_inegration/docker/set_env_vars_default.sh
function local_or_cloud_menu {
printf '\n Where the "Prometheus" installation is planned? \n'
PS3='Please enter your choice: # '
options=("with container locally # 1" "on the cloud using terraform # 2" "Quit")
select opt in "${options[@]}"
do
case $opt in
"with container locally # 1")
echo "you chose choice (1) container locally installation"
default_collisions_check
exit
;;
"on the cloud using terraform # 2")
echo "Excuse me! this functionality is not ready yet"
;;
"Quit")
exit
;;
*) echo "invalid option $REPLY";;
esac
done
}
function default_collisions_check {
echo "default collisions check"
source $PWD/docker/services_availability_tests.sh
serices_availability_check 0.0.0.0 80 433
[ "$AVAILABILITY_STATUS" = true ] && availability_warn || echo "All services are available."
}
function availability_warn {
cat <<-\_several_strings_
it looks like one or more IP or ports busy with other processes
please take a look at the file with variables:
_several_strings_
echo $PWD/docker/services_availability_tests.sh
cat <<-\_several_strings_
you can change the value of the variables,
but we strongly recommend that you do not change the name of the variables,
since they are referenced by some configuration components,
if necessary you can add your own variables
_several_strings_
PS3='Please enter your next choice: '
options=("Start the installation with the default values # 1" "Show the default variables # 2" "Customize the configuration and change the default values # 3" "Quit")
select opt in "${options[@]}"
do
case $opt in
"Start the installation with the default values # 1")
echo "you chose choice the installation with the default values started"
source $PWD/docker/make_compose_component.sh
break
;;
"Show the default variables # 2")
echo "show the default variables 2"
cat $PWD/docker/set_env_vars_default.sh
;;
"Customize the configuration and change the default values # 3")
echo "you chose choice $REPLY which is $opt"
break
;;
"Quit")
exit
;;
*) echo "invalid option $REPLY";;
esac
done
}
local_or_cloud_menu