feat:优化流水线

This commit is contained in:
2025-07-28 09:07:26 +08:00
parent 1158aba04b
commit 7b1d450e37
Vendored
+6 -1
View File
@@ -42,13 +42,18 @@ pipeline {
agent any agent any
steps { steps {
script { script {
def lastStatus = ''
timeout(time: 60, unit: 'SECONDS') { timeout(time: 60, unit: 'SECONDS') {
waitUntil { waitUntil {
def status = sh( def status = sh(
script: "docker inspect -f '{{.State.Health.Status}}' $CONTAINER_NAME || echo 'unhealthy'", script: "docker inspect -f '{{.State.Health.Status}}' $CONTAINER_NAME || echo 'unhealthy'",
returnStdout: true returnStdout: true
).trim() ).trim()
echo "Current container status: ${status}"
if (status != lastStatus) {
echo "Container health: ${status}"
lastStatus = status
}
return (status == 'healthy') return (status == 'healthy')
} }
} }