feat:加入健康检查
This commit is contained in:
Vendored
+17
@@ -57,5 +57,22 @@ pipeline {
|
||||
'''
|
||||
}
|
||||
}
|
||||
|
||||
stage('Run Docker Container') {
|
||||
agent any
|
||||
steps {
|
||||
sh '''
|
||||
docker rm -f $CONTAINER_NAME || true
|
||||
docker run -d --name $CONTAINER_NAME \\
|
||||
-p $HOST_PORT:$CONTAINER_PORT \\
|
||||
--health-cmd="curl -f http://localhost:$CONTAINER_PORT || exit 1" \\
|
||||
--health-interval=10s \\
|
||||
--health-timeout=5s \\
|
||||
--health-retries=3 \\
|
||||
$IMAGE_NAME
|
||||
'''
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user