From 96a082a8056016b6780d156eba6574893e66fd00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=B0=8F=E4=BA=91?= Date: Wed, 11 Jun 2025 12:52:16 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nginx/replace_vars.sh | 9 ++++----- 巴中部署文档.md | 9 +++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/nginx/replace_vars.sh b/nginx/replace_vars.sh index 29bca22..3b5a3dc 100755 --- a/nginx/replace_vars.sh +++ b/nginx/replace_vars.sh @@ -40,13 +40,12 @@ for conf_file in vhosts/*.conf; do # 读取原始文件内容 content=$(cat "$conf_file") - # 获取environment.sh中所有环境变量 - env_vars=$(grep -E "^export [A-Z_]+" ../environment.sh | sed 's/export //') + # 获取所有环境变量(包括export和非export的) + env_vars=$(env | grep -E "^[A-Z_]+=" | cut -d= -f1) # 逐个替换环境变量 - for var in $env_vars; do - var_name=$(echo $var | cut -d= -f1) - var_value=${!var_name} + for var_name in $env_vars; do + var_value="${!var_name}" if [ ! -z "$var_value" ]; then # 使用更安全的变量替换方法 pattern="\\\${$var_name}" diff --git a/巴中部署文档.md b/巴中部署文档.md index 66ccbf6..47d5622 100644 --- a/巴中部署文档.md +++ b/巴中部署文档.md @@ -10,12 +10,13 @@ host 文件中添加以下内容 2.3 联系拓恒提供mysql刷数脚本 3: 将修改后的 bazhong.sh 文件提供给 拓恒 4: 拓恒打镜像 -5: 依次执行 start文件夹下的启动脚本; 采用 ./xxx.sh 的方式执行,不要使用 sh ./xxx.sh 的方式执行; 执行前需要 source bazhong.sh +5: 依次执行 start文件夹下的启动脚本; 采用 ./xxx.sh 的方式执行,不要使用 sh ./xxx.sh 的方式执行; 5.1 oidcservice 5.2 hhzadmin 5.3 hhzapi 5.4 dspapi - 5.5 网关的启动脚本上 startGateWay.sh (replace_vars.sh 不需要手动执行) - 5.6 ginx.sh 启动脚本最后执行 + 5.5 网关的启动脚本 gateway/startGateWay.sh (replace_vars.sh 不需要手动执行) + 5.6 nginx.sh 启动脚本最后执行 - \ No newline at end of file + +后期升级的时候,只需要执行start文件夹下的启动脚本,之前前都需要执行 source ../bazhong.sh \ No newline at end of file