Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script housekeeping #354

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions scripts/installation/all-in-one.sh
Original file line number Diff line number Diff line change
Expand Up @@ -635,8 +635,8 @@ function arch() {
function _download_tool() {
local name=$1 url=$2
local file=/usr/local/bin/$name
curl -Lo $file $url
chmod +x $file
curl -Lo "$file" "$url"
chmod +x "$file"
}

function check_command_exists() {
Expand All @@ -645,7 +645,7 @@ function check_command_exists() {

function ensure_tool() {
local command=$1 download_url=$2
if check_command_exists $command; then
if check_command_exists "$command"; then
return
fi

Expand Down
26 changes: 13 additions & 13 deletions scripts/installation/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ SEDNA_VERSION=v${SEDNA_VERSION#v}
_download_yamls() {

yaml_dir=$1
mkdir -p ${SEDNA_ROOT}/$yaml_dir
cd ${SEDNA_ROOT}/$yaml_dir
for yaml in ${yaml_files[@]}; do
mkdir -p "${SEDNA_ROOT}/$yaml_dir"
cd "${SEDNA_ROOT}/$yaml_dir"
for yaml in "${yaml_files[@]}"; do
# the yaml file already exists, no need to download
[ -e "$yaml" ] && continue

Expand Down Expand Up @@ -93,7 +93,7 @@ prepare_install(){
}

prepare() {
mkdir -p ${SEDNA_ROOT}
mkdir -p "${SEDNA_ROOT}"

# we only need build directory
# here don't use git clone because of large vendor directory
Expand All @@ -105,12 +105,12 @@ cleanup(){
}

create_crds() {
cd ${SEDNA_ROOT}
cd "${SEDNA_ROOT}"
kubectl create -f build/crds
}

delete_crds() {
cd ${SEDNA_ROOT}
cd "${SEDNA_ROOT}"
kubectl delete -f build/crds --timeout=90s
}

Expand All @@ -123,7 +123,7 @@ get_service_address() {
}

create_kb(){
cd ${SEDNA_ROOT}
cd "${SEDNA_ROOT}"

kubectl $action -f - <<EOF
apiVersion: v1
Expand Down Expand Up @@ -198,9 +198,9 @@ prepare_gm_config_map() {
config_file=${TMP_DIR}/${2:-gm.yaml}

if [ -n "${SEDNA_GM_CONFIG:-}" ] && [ -f "${SEDNA_GM_CONFIG}" ] ; then
cp "$SEDNA_GM_CONFIG" $config_file
cp "$SEDNA_GM_CONFIG" "$config_file"
else
cat > $config_file << EOF
cat > "$config_file" << EOF
kubeConfig: ""
master: ""
namespace: ""
Expand All @@ -214,12 +214,12 @@ knowledgeBaseServer:
EOF
fi

kubectl $action -n sedna configmap $cm_name --from-file=$config_file
kubectl $action -n sedna configmap $cm_name --from-file="$config_file"
}

create_gm() {

cd ${SEDNA_ROOT}
cd "${SEDNA_ROOT}"

kubectl create -f build/gm/rbac/

Expand Down Expand Up @@ -290,7 +290,7 @@ EOF
}

delete_gm() {
cd ${SEDNA_ROOT}
cd "${SEDNA_ROOT}"

kubectl delete -f build/gm/rbac/

Expand Down Expand Up @@ -433,6 +433,6 @@ case "$action" in
delete_lc
delete_crds
cleanup
echo "$(green_text Sedna is uninstalled successfully)"
green_text Sedna is uninstalled successfully
;;
esac