-
Notifications
You must be signed in to change notification settings - Fork 0
/
start_bi_app.sh
executable file
·140 lines (122 loc) · 3.38 KB
/
start_bi_app.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
#!/bin/bash
# ======================================================================================
# Created by: [email protected]
# Created at: 25/04/2023
# ======================================================================================
export TERM=xterm
echo "=================================================================================="
echo "[ CHECKING APPLICATION . . . ]"
echo "=================================================================================="
echo
# Check for folder existence
dir="./data"
if [ -d $dir ]; then
echo "===> [OK] - '/data' directory found!"
else
echo "===> [NOK] - '/data' directory NOT found!"
exit
fi
dir="./logs"
if [ -d $dir ]; then
echo "===> [OK] - '/logs' directory found!"
else
echo "===> [NOK] - '/logs' directory NOT found!"
exit
fi
dir="./src"
if [ -d $dir ]; then
echo "===> [OK] - '/src' directory found!"
else
echo "===> [NOK] - '/src' directory NOT found!"
exit
fi
# Check for file existence
file="./src/load/put_bt_empresas_in_dw.py"
if [ -e $file ]; then
echo "===> [OK] - SCRIPT: put_bt_empresas_in_dw.py found"
else
echo "===> [NOK] - SCRIPT: put_bt_empresas_in_dw.py NOT found!"
exit
fi
file="./src/utils/dw_operations.py"
if [ -e $file ]; then
echo "===> [OK] - SCRIPT: dw_operations.py found"
else
echo "===> [NOK] - SCRIPT: dw_operations.py NOT found!"
exit
fi
file="./src/utils/logger_app.py"
if [ -e $file ]; then
echo "===> [OK] - SCRIPT: logger_app.py found"
else
echo "===> [NOK] - SCRIPT: logger_app.py NOT found!"
exit
fi
file="wat.py"
if [ -e $file ]; then
echo "===> [OK] - SCRIPT: wat.py found"
else
echo "===> [NOK] - SCRIPT: wat.py NOT found!"
exit
fi
file="config.py"
if [ -e $file ]; then
echo "===> [OK] - SCRIPT: config.py found"
else
echo "===> [NOK] - SCRIPT: config.py NOT found!"
exit
fi
file="dash_tool.py"
if [ -e $file ]; then
echo "===> [OK] - SCRIPT: dash_tool.py found"
else
echo "===> [NOK] - SCRIPT: dash_tool.py NOT found!"
exit
fi
file="eda_tool.py"
if [ -e $file ]; then
echo "===> [OK] - SCRIPT: eda_tool.py found"
else
echo "===> [NOK] - SCRIPT: eda_tool.py NOT found!"
exit
fi
file="login.py"
if [ -e $file ]; then
echo "===> [OK] - SCRIPT: login.py found"
else
echo "===> [NOK] - SCRIPT: login.py NOT found!"
exit
fi
file="test_gml_bi.py"
if [ -e $file ]; then
echo "===> [OK] - SCRIPT: test_gml_bi.py found"
else
echo "===> [NOK] - SCRIPT: test_gml_bi.py NOT found!"
exit
fi
echo
echo "=================================================================================="
echo "[ TESTING APPLICATION . . . ]"
echo "=================================================================================="
echo
# Check if file is readable/executable
file="test_gml_bi.py"
if [ -r $file ]; then
python3 $file
else
echo "===> [NOK] - SCRIPT: 'test_gml_bi.py' is NOT readable!"
exit
fi
echo
echo "=================================================================================="
echo "[ STARTING APPLICATION . . . ]"
echo "=================================================================================="
echo
# Check if file is readable/executable
file="login.py"
if [ -r $file ]; then
streamlit run $file --server.port=8501 --server.address=0.0.0.0
else
echo "===> [NOK] - SCRIPT: 'dash_tool' is NOT readable!"
exit
fi