This commit is contained in:
runny committed 2026-05-12 15:48:51 +08:00
1 parent 13ecfc3e42
commit cb88f02b40
4 files changed
+55 -3

No files matched your search

+20
View File
@@ -19,6 +19,21 @@ DEPLOY_CONFIG_CHANGED="${6:-false}"
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
COMPOSE_FILE="${ROOT_DIR}/docker-compose.yml"
ENV_FILE="${ROOT_DIR}/.env.${ENV_NAME}"
ORACLE_CLIENT_DIR="${ROOT_DIR}/oracle_client"
check_oracle_client() {
if [[ ! -d "${ORACLE_CLIENT_DIR}" ]]; then
echo "Missing Oracle Instant Client directory: ${ORACLE_CLIENT_DIR}"
echo "Please prepare oracle_client under the project root so docker-compose can mount it to /app/oracle_client."
exit 1
fi
if ! find "${ORACLE_CLIENT_DIR}" \( -iname "oci.dll" -o -iname "libclntsh.so" -o -iname "libclntsh.dylib" -o -type d -name "instantclient_*" \) | grep -q .; then
echo "Oracle Instant Client directory exists but no client library was found: ${ORACLE_CLIENT_DIR}"
echo "Expected extracted Instant Client files such as instantclient_* / oci.dll / libclntsh.so."
exit 1
fi
}
# 基础文件检查:compose 文件必须存在
if [[ ! -f "${COMPOSE_FILE}" ]]; then
@@ -91,6 +106,11 @@ echo "Deploying environment: ${ENV_NAME}"
echo "Services: ${services[*]}"
echo "Prebuilt image mode: ${PREBUILT_MODE}"
if printf '%s\n' "${services[@]}" | grep -qx "hxops-backend"; then
echo "Checking Oracle Instant Client directory..."
check_oracle_client
fi
# 预构建镜像模式:只启动,不构建
# 非预构建镜像模式:在目标机本地构建并启动
if [[ "${PREBUILT_MODE}" == "true" ]]; then