clouddreamai-cicd-setup 1.5.39 → 1.5.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/templates/scripts/deploy.sh +10 -0
package/package.json
CHANGED
|
@@ -393,7 +393,17 @@ create_database() {
|
|
|
393
393
|
fi
|
|
394
394
|
fi
|
|
395
395
|
|
|
396
|
+
# 检查 PostgreSQL 是否实际监听所有地址(配置可能已改但未重启)
|
|
397
|
+
if ! netstat -tlnp 2>/dev/null | grep -q "0.0.0.0:5432"; then
|
|
398
|
+
echo "检测到 PostgreSQL 未监听所有地址,需要重启..."
|
|
399
|
+
PG_RESTART_NEEDED=true
|
|
400
|
+
fi
|
|
401
|
+
|
|
396
402
|
if [ "$PG_RESTART_NEEDED" = true ]; then
|
|
403
|
+
# 先停掉旧容器,避免 PostgreSQL 重启后出现共享内存错误
|
|
404
|
+
echo "停止旧容器(如果存在)..."
|
|
405
|
+
docker container ls -q --filter "name=$APP_NAME" | xargs -r docker container stop 2>/dev/null || true
|
|
406
|
+
|
|
397
407
|
echo "重启 PostgreSQL 服务..."
|
|
398
408
|
# 宝塔 PostgreSQL 需要用 postgres 用户重启,且必须用 restart 而非 reload 才能让 listen_addresses 生效
|
|
399
409
|
if [ -x "/www/server/pgsql/bin/pg_ctl" ]; then
|