feat:增加健康检查

This commit is contained in:
2025-07-27 19:13:13 +08:00
parent 6ec5f11894
commit 1158aba04b
2 changed files with 21 additions and 0 deletions
Vendored
+18
View File
@@ -37,5 +37,23 @@ pipeline {
'''
}
}
stage('Check Docker Status') {
agent any
steps {
script {
timeout(time: 60, unit: 'SECONDS') {
waitUntil {
def status = sh(
script: "docker inspect -f '{{.State.Health.Status}}' $CONTAINER_NAME || echo 'unhealthy'",
returnStdout: true
).trim()
echo "Current container status: ${status}"
return (status == 'healthy')
}
}
}
}
}
}
}