diff --git a/deploy/scripts/6-install-databases/install_databases.sh b/deploy/scripts/6-install-databases/install_databases.sh index 02de40129a432ed300265ced5016ed0497155966..5bba41a8f18c2bd623afecdeb8ceab4af2a6c404 100755 --- a/deploy/scripts/6-install-databases/install_databases.sh +++ b/deploy/scripts/6-install-databases/install_databases.sh @@ -8,7 +8,15 @@ BLUE='\033[34m' NC='\033[0m' -chart_dir="/home/euler-copilot-framework/deploy/chart" +SCRIPT_PATH="$( + cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 + pwd +)/$(basename "${BASH_SOURCE[0]}")" + +CHART_DIR="$( + canonical_path=$(readlink -f "$SCRIPT_PATH" 2>/dev/null || echo "$SCRIPT_PATH") + dirname "$(dirname "$(dirname "$canonical_path")")" +)/chart" # 获取系统架构 get_architecture() { @@ -87,11 +95,11 @@ delete_pvcs() { helm_install() { echo -e "${BLUE}==> 进入部署目录...${NC}" - [ ! -d "$chart_dir" ] && { - echo -e "${RED}错误:部署目录不存在 $chart_dir${NC}" + [ ! -d "$CHART_DIR" ] && { + echo -e "${RED}错误:部署目录不存在 $CHART_DIR${NC}" return 1 } - cd "$chart_dir" + cd "$CHART_DIR" echo -e "${BLUE}正在安装 databases...${NC}" helm upgrade --install databases --set globals.arch=$arch -n euler-copilot ./databases || { diff --git a/deploy/scripts/7-install-authhub/install_authhub.sh b/deploy/scripts/7-install-authhub/install_authhub.sh index 3fca42fadec1cb5cecdb12980efe7e2762815963..1dedad398e2932198b8fe6cbe8e9c75d1a3057b2 100755 --- a/deploy/scripts/7-install-authhub/install_authhub.sh +++ b/deploy/scripts/7-install-authhub/install_authhub.sh @@ -8,7 +8,15 @@ YELLOW='\033[33m' BLUE='\033[34m' NC='\033[0m' -DEPLOY_DIR="/home/euler-copilot-framework/deploy" +SCRIPT_PATH="$( + cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 + pwd +)/$(basename "${BASH_SOURCE[0]}")" + +CHART_DIR="$( + canonical_path=$(readlink -f "$SCRIPT_PATH" 2>/dev/null || echo "$SCRIPT_PATH") + dirname "$(dirname "$(dirname "$canonical_path")")" +)/chart" # 获取系统架构 get_architecture() { @@ -90,11 +98,11 @@ get_user_input() { helm_install() { local arch="$1" echo -e "${BLUE}==> 进入部署目录...${NC}" - [ ! -d "${DEPLOY_DIR}/chart" ] && { - echo -e "${RED}错误:部署目录不存在 ${DEPLOY_DIR}/chart ${NC}" + [ ! -d "${CHART_DIR}" ] && { + echo -e "${RED}错误:部署目录不存在 ${CHART_DIR} ${NC}" return 1 } - cd "${DEPLOY_DIR}/chart" + cd "${CHART_DIR}" echo -e "${BLUE}正在安装 authhub...${NC}" helm upgrade --install authhub -n euler-copilot ./authhub \ diff --git a/deploy/scripts/8-install-EulerCopilot/install_eulercopilot.sh b/deploy/scripts/8-install-EulerCopilot/install_eulercopilot.sh index 1f5e239aeaf2a94c38593d5699e40558114fb177..c2ddc020012518300d2174eccaf60b3925e4760f 100755 --- a/deploy/scripts/8-install-EulerCopilot/install_eulercopilot.sh +++ b/deploy/scripts/8-install-EulerCopilot/install_eulercopilot.sh @@ -10,9 +10,18 @@ BLUE='\e[34m' NC='\e[0m' # 恢复默认颜色 NAMESPACE="euler-copilot" -DEPLOY_DIR="/home/euler-copilot-framework/deploy" PLUGINS_DIR="/home/eulercopilot/semantics" +SCRIPT_PATH="$( + cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 + pwd +)/$(basename "${BASH_SOURCE[0]}")" + +DEPLOY_DIR="$( + canonical_path=$(readlink -f "$SCRIPT_PATH" 2>/dev/null || echo "$SCRIPT_PATH") + dirname "$(dirname "$(dirname "$canonical_path")")" +)" + # 获取系统架构 get_architecture() { diff --git a/deploy/scripts/9-other-script/install_oidc_eulercopilot.sh b/deploy/scripts/9-other-script/install_oidc_eulercopilot.sh index 4d5e3531707ebef423ecdc0661af54ffa8216e10..f098aedb893f7c42e2d64ac9c6c1722eab94cbf2 100755 --- a/deploy/scripts/9-other-script/install_oidc_eulercopilot.sh +++ b/deploy/scripts/9-other-script/install_oidc_eulercopilot.sh @@ -16,8 +16,17 @@ YELLOW='\e[33m' BLUE='\e[34m' NC='\e[0m' # 恢复默认颜色 -DEPLOY_DIR=/home/euler-copilot-framework/deploy PLUGINS_DIR="/home/eulercopilot/semantics" +SCRIPT_PATH="$( + cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 + pwd +)/$(basename "${BASH_SOURCE[0]}")" + +DEPLOY_DIR="$( + canonical_path=$(readlink -f "$SCRIPT_PATH" 2>/dev/null || echo "$SCRIPT_PATH") + dirname "$(dirname "$(dirname "$canonical_path")")" +)" + get_eth0_ip() { echo -e "${BLUE}获取 eth0 网络接口 IP 地址...${NC}"