初始化项目
Some checks failed
Java Maven 3.9.9 & JDK 26 CI/CD Pipeline / build-and-deploy (push) Failing after 13s

This commit is contained in:
Lee 2026-06-08 16:23:09 +08:00
parent 85ac8274f9
commit e0bc320cd3

View File

@ -57,10 +57,15 @@ jobs:
# 循环探活:每隔 5 秒检测一次,最多尝试 15 次(总计 75 秒,给高版本 JVM 充足的预热时间)
for i in {1..15}; do
# 发送轻量级请求只要服务响应了无论是200还是Spring默认的404/无路由),都证明 Tomcat/Netty 已拉起
if curl -s -f http://localhost:${APP_PORT}/hello > /dev/null; then
echo "✅ [SUCCESS] 探活成功Java 26 服务已成功拉起,并开始提供服务。"
exit 0
fi
if wget -q --spider http://localhost:${APP_PORT}/; then
echo "✅ [SUCCESS] 探活成功Java 26 服务已成功拉起。"
echo "🧹 开始安全地清理历史无用镜像及过期构建缓存..."
docker image prune -f
docker builder prune --filter "until=24h" -f
exit 0
fi
echo "⏳ [WAITING] 服务仍在启动中,等待 5 秒后重试 ($i/15)..."
sleep 5
done