-
Notifications
You must be signed in to change notification settings - Fork 0
/
use.sh
343 lines (340 loc) · 8.37 KB
/
use.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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
#!/bin/bash
# set -u
for i in $(find libs/* -type f); do
source $i &>/dev/null
done
if [ $1 == install ]; then
if [ $3 == 1000 ]; then
env=$2
fate_ns=fate-1000
fedx_ns=fedx-1000
elif [ $3 == 1100 ]; then
env=$2
fate_ns=fate-1100
fedx_ns=fedx-1100
elif [ $3 == 2000 ]; then
env=$2
fate_ns=fate-2000
fedx_ns=fedx-2000
else
echo "error"
fi
elif [ $1 == uninstall ]; then
if [ $3 == 1000 ]; then
env=$2
fate_ns=fate-1000
fedx_ns=fedx-1000
elif [ $3 == 1100 ]; then
env=$2
fate_ns=fate-1100
fedx_ns=fedx-1100
elif [ $3 == 2000 ]; then
env=$2
fate_ns=fate-2000
fedx_ns=fedx-2000
else
echo "error"
fi
elif [ $1 == touch_log ]; then
touch_log
elif [ $1 == pre_check ]; then
pre_check
elif [ $1 == ssh_login ]; then
ssh_login
elif [ $1 == import_docker_images ]; then
import_docker_images
elif [ $1 == install_nfs ]; then
install_nfs
elif [ $1 == install_nfs_provisioner ]; then
install_nfs_provisioner
elif [ $1 == install_kubefate ]; then
install_kubefate
elif [ $1 == install_fate ]; then
if [ $3 == 1000 ]; then
fate_ns=fate-1000
install_fate
elif [ $3 == 1100 ]; then
party_id=$3
fate_ns=fate-1100
install_fate
elif [ $3 == 2000 ]; then
party_id=$3
fate_ns=fate-2000
install_fate
else
echo "error"
fi
elif [ $1 == install_fate-serving ]; then
if [ $3 == 1000 ]; then
serving_ns=fate-serving-1000
install_fate-serving
elif [ $3 == 1100 ]; then
serving_ns=fate-serving-1100
install_fate-serving
elif [ $3 == 2000 ]; then
serving_ns=fate-serving-2000
install_fate-serving
else
echo "error"
fi
elif [ $1 == install_fedx-custom ]; then
if [ $3 == 1000 ]; then
fedx_custom_ns=fedx-custom-1000
party_id=1000
install_fedx-custom
elif [ $3 == 1100 ]; then
fedx_custom_ns=fedx-custom-1100
party_id=1100
install_fedx-custom
elif [ $3 == 2000 ]; then
fedx_custom_ns=fedx-custom-2000
party_id=2000
install_fedx-custom
else
echo "error"
fi
elif [ $1 == install_fedx ]; then
if [ $3 == 1000 ]; then
fedx_ns=fedx-1000
install_fedx
elif [ $3 == 1100 ]; then
fedx_ns=fedx-1100
install_fedx
elif [ $3 == 2000 ]; then
fedx_ns=fedx-2000
install_fedx
else
echo "error"
fi
elif [ $1 == install_bsd ]; then
if [ $3 == 1000 ]; then
bsd_ns=bsd-1000
install_bsd
elif [ $3 == 1100 ]; then
bsd_ns=bsd-1100
install_bsd
elif [ $3 == 2000 ]; then
bsd_ns=bsd-2000
install_bsd
else
echo "error"
fi
elif [ $1 == install_fedx_scql ]; then
if [ $3 == 1000 ]; then
fedx_ns=fedx-1000
install_fedx_scql
elif [ $3 == 1100 ]; then
fedx_ns=fedx-1100
install_fedx_scql
elif [ $3 == 2000 ]; then
fedx_ns=fedx-2000
install_fedx_scql
else
echo "error"
fi
elif [ $1 == install_middleware ]; then
if [ $3 == 1000 ]; then
fedx_ns=fedx-1000
install_middleware
elif [ $3 == 1100 ]; then
fedx_ns=fedx-1100
install_middleware
elif [ $3 == 2000 ]; then
fedx_ns=fedx-2000
install_middleware
else
echo "error"
fi
elif [ $1 == install_bsd_middleware ]; then
if [ $3 == 1000 ]; then
bsd_ns=bsd-1000
install_bsd_middleware
elif [ $3 == 1100 ]; then
bsd_ns=bsd-1100
install_bsd_middleware
elif [ $3 == 2000 ]; then
bsd_ns=bsd-2000
install_bsd_middleware
else
echo "error"
fi
elif [ $1 == uninstall_middleware ]; then
if [ $2 == 1000 ]; then
fedx_ns=fedx-1000
uninstall_middleware
elif [ $2 == 1100 ]; then
fedx_ns=fedx-1100
uninstall_middleware
elif [ $2 == 2000 ]; then
fedx_ns=fedx-2000
uninstall_middleware
else
echo "error"
fi
elif [ $1 == uninstall_fedx-custom ]; then
if [ $2 == 1000 ]; then
fedx_ns=fedx-custom-1000
uninstall_fedx-custom
elif [ $2 == 1100 ]; then
fedx_ns=fedx-custom-1100
uninstall_fedx-custom
elif [ $2 == 2000 ]; then
fedx_ns=fedx-custom-2000
uninstall_fedx-custom
else
echo "error"
fi
elif [ $1 == uninstall_kubefate ]; then
uninstall_kubefate
elif [ $1 == uninstall_fate ]; then
if [ $2 == 1000 ]; then
fate_ns=fate-1000
uninstall_fate
elif [ $2 == 1100 ]; then
fate_ns=fate-1100
uninstall_fate
elif [ $2 == 2000 ]; then
fate_ns=fate-2000
uninstall_fate
else
echo "error"
fi
elif [ $1 == uninstall_fate-serving ]; then
if [ $2 == 1000 ]; then
fate_ns=fate-1000
uninstall_fate-serving
elif [ $2 == 1100 ]; then
fate_ns=fate-1100
uninstall_fate-serving
elif [ $2 == 2000 ]; then
fate_ns=fate-2000
uninstall_fate-serving
else
echo "error"
fi
elif [ $1 == uninstall_fedx ]; then
if [ $2 == 1000 ]; then
fedx_ns=fedx-1000
uninstall_fedx
elif [ $2 == 1100 ]; then
fedx_ns=fedx-1100
uninstall_fedx
elif [ $2 == 2000 ]; then
fedx_ns=fedx-2000
uninstall_fedx
else
echo "error"
fi
elif [ $1 == delete_pvc_fate ]; then
if [ $2 == 1000 ]; then
fate_ns=fate-1000
delete_pvc_fate
elif [ $2 == 1100 ]; then
fate_ns=fate-1100
delete_pvc_fate
elif [ $2 == 2000 ]; then
fate_ns=fate-2000
delete_pvc_fate
else
echo "error"
fi
elif [ $1 == check_toy ]; then
check_toy
elif [ $1 == reset_mysql ]; then
reset_mysql
elif [ $1 == update_version ]; then
update_version
elif [ $1 == install_longhorn ]; then
echo "install_longhorn脚本已删除"
elif [ $1 == check_toy_all ]; then
check_toy_all
elif [ $1 == check_pulsar ]; then
check_pulsar
elif [ $1 == reset ]; then
reset
elif [ $1 == install_all ]; then
touch_log
if [ "$3" = "1000" ]; then
env=$2
fate_ns=fate-1000
fedx_ns=fedx-1000
serving_ns=fate-serving-1000
fedx_custom_ns=fedx-custom-1000
install_all 2>&1 | tee -i $pwd/${current_time}.log
elif [ "$3" = "1100" ]; then
env=$2
fate_ns=fate-1100
fedx_ns=fedx-1100
serving_ns=fate-serving-1100
fedx_custom_ns=fedx-custom-1100
install_all 2>&1 | tee -i $pwd/${current_time}.log
elif [ "$3" = "2000" ]; then
env=$2
fate_ns=fate-2000
fedx_ns=fedx-2000
serving_ns=fate-serving-2000
fedx_custom_ns=fedx-custom-2000
install_all 2>&1 | tee -i $pwd/${current_time}.log
else
echo "error"
fi
elif [ $1 == uninstall_all ]; then
if [ $2 == 1000 ]; then
fate_ns=fate-1000
fedx_ns=fedx-1000
fedx_custom_ns=fedx-custom-1000
uninstall_all
elif [ $2 == 1100 ]; then
fate_ns=fate-1100
fedx_ns=fedx-1100
fedx_custom_ns=fedx-custom-1100
uninstall_all
elif [ $2 == 2000 ]; then
fate_ns=fate-2000
fedx_ns=fedx-2000
fedx_custom_ns=fedx-custom-2000
uninstall_all
else
echo "error"
fi
elif [ $1 == delete_pvc_all ]; then
if [ $2 == 1000 ]; then
fate_ns=fate-1000
fedx_ns=fedx-1000
fedx_custom_ns=fedx-custom-1000
delete_pvc_all
elif [ $2 == 1100 ]; then
fate_ns=fate-1100
fedx_ns=fedx-1100
fedx_custom_ns=fedx-custom-1100
delete_pvc_all
elif [ $2 == 2000 ]; then
fate_ns=fate-2000
fedx_ns=fedx-2000
fedx_custom_ns=fedx-custom-2000
delete_pvc_all
else
echo "error"
fi
elif [ $1 == restart_pod ]; then
restart_pod
elif [ $1 == update_sql ]; then
update_sql
elif [ $1 == init_sql ]; then
if [ $3 == 1000 ]; then
fedx_ns=fedx-1000
init_sql
elif [ $3 == 1100 ]; then
fedx_ns=fedx-1100
init_sql
elif [ $3 == 2000 ]; then
fedx_ns=fedx-2000
init_sql
else
echo "error"
fi
elif [ $1 == save_images ]; then
save_images
else
echo -e "\033[42;37m 参数错误 \033[0m"
fi