From eabc012865386c75b6ca5e240681e9d3a255443e Mon Sep 17 00:00:00 2001 From: Hongyu Shi Date: Mon, 1 Sep 2025 16:18:55 +0800 Subject: [PATCH] =?UTF-8?q?feat(deploy):=20=E6=94=AF=E6=8C=81=E5=8D=8E?= =?UTF-8?q?=E4=B8=BA=E4=BA=91=20HCE=20=E5=8F=91=E8=A1=8C=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Hongyu Shi --- scripts/deploy/1-check-env/check_env.sh | 4 ++++ src/app/deployment/service.py | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/deploy/1-check-env/check_env.sh b/scripts/deploy/1-check-env/check_env.sh index df90c3e..398bc67 100644 --- a/scripts/deploy/1-check-env/check_env.sh +++ b/scripts/deploy/1-check-env/check_env.sh @@ -208,6 +208,10 @@ function check_os_version { local supported_versions=("24.03") check_version "$version" "${supported_versions[@]}" "$sp" ;; + "hce") + echo -e "${COLOR_INFO}[Info] 检测到 HCE 发行版,跳过版本检查${COLOR_RESET}" + return 0 + ;; *) echo -e "${COLOR_ERROR}[Error] 发行版不受支持,脚本将退出${COLOR_RESET}" return 1 diff --git a/src/app/deployment/service.py b/src/app/deployment/service.py index 7a6bf59..d38f9e1 100644 --- a/src/app/deployment/service.py +++ b/src/app/deployment/service.py @@ -221,12 +221,13 @@ class DeploymentService: os_release_path = Path("/etc/os-release") if os_release_path.exists(): content = os_release_path.read_text(encoding="utf-8").lower() - if "openeuler" in content: + if "openeuler" in content or "huawei cloud euleros" in content: return True # 检查 /etc/openEuler-release openeuler_release_path = Path("/etc/openEuler-release") - if openeuler_release_path.exists(): + hce_release_path = Path("/etc/hce-release") + if openeuler_release_path.exists() or hce_release_path.exists(): return True except OSError as e: -- Gitee