初始化项目
Some checks failed
Java Maven 3.9.9 & JDK 26 CI/CD Pipeline / build-and-deploy (push) Failing after 13s
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:
parent
85ac8274f9
commit
e0bc320cd3
@ -57,8 +57,13 @@ 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 服务已成功拉起,并开始提供服务。"
|
||||
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)..."
|
||||
|
||||
Loading…
Reference in New Issue
Block a user