This repository has been archived by the owner on Nov 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
run.sh
executable file
·78 lines (61 loc) · 1.6 KB
/
run.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
SHELL_DIR=$(dirname $0)
. ${SHELL_DIR}/common.sh
. ${SHELL_DIR}/default.sh
################################################################################
prepare() {
logo
mkdir -p ~/.ssh
mkdir -p ~/.aws
NEED_TOOL=
command -v jq > /dev/null || export NEED_TOOL=jq
command -v git > /dev/null || export NEED_TOOL=git
command -v aws > /dev/null || export NEED_TOOL=awscli
command -v kubectl > /dev/null || export NEED_TOOL=kubectl
command -v kops > /dev/null || export NEED_TOOL=kops
command -v helm > /dev/null || export NEED_TOOL=helm
if [ ! -z ${NEED_TOOL} ]; then
question "Do you want to install the required tools? (awscli,kubectl,kops,helm...) [Y/n] : "
if [ "${ANSWER:-Y}" == "Y" ]; then
${SHELL_DIR}/tools.sh
else
_error "Need install tools."
fi
fi
REGION="$(aws configure get default.region)"
}
usage() {
cat <<EOF
Usage: `basename $0` {Command}
Commands:
kops kops 로 클러스터를 관리 합니다.
helm helm 으로 클러스터의 Application 을 관리합니다.
tools 필요한 Tool 을 설치 합니다.
================================================================================
EOF
_success
}
run_kops() {
${SHELL_DIR}/kops.sh
}
run_helm() {
${SHELL_DIR}/helm.sh
}
run() {
prepare
case ${CMD} in
kops)
run_kops
;;
helm)
run_helm
;;
tools)
update_tools
;;
*)
usage
;;
esac
}
CMD=$1
run