fix: iot-gateway去除健康检查、nacos配置
This commit is contained in:
35
Jenkinsfile
vendored
35
Jenkinsfile
vendored
@@ -878,6 +878,25 @@ def deployService(String service) {
|
||||
|
||||
// 等待服务健康
|
||||
def waitForServiceHealthy(String containerName, String serviceName, String sshOpts) {
|
||||
// iot-gateway 是轻量化网关,不需要健康检查,只检查容器是否运行
|
||||
if (serviceName == 'viewsh-module-iot-gateway') {
|
||||
echo "⏳ Waiting for ${serviceName} to start (lightweight gateway, no health check)..."
|
||||
sh """
|
||||
ssh ${sshOpts} root@${env.DEPLOY_HOST} '
|
||||
set -e
|
||||
sleep 5
|
||||
if docker ps | grep -q ${containerName}; then
|
||||
echo "✅ ${serviceName} is running"
|
||||
else
|
||||
echo "❌ ${serviceName} is not running"
|
||||
docker logs --tail 50 ${containerName} 2>/dev/null || true
|
||||
exit 1
|
||||
fi
|
||||
'
|
||||
"""
|
||||
return
|
||||
}
|
||||
|
||||
def maxAttempts = env.HEALTH_CHECK_TIMEOUT.toInteger() / env.HEALTH_CHECK_INTERVAL.toInteger()
|
||||
|
||||
echo "⏳ Waiting for ${serviceName} to be healthy (max ${env.HEALTH_CHECK_TIMEOUT}s)..."
|
||||
@@ -934,6 +953,22 @@ def checkServiceHealthWithRetry(String service) {
|
||||
|
||||
// 检查服务健康状态
|
||||
def checkServiceHealth(String containerName, String serviceName, String sshOpts) {
|
||||
// iot-gateway 是轻量化网关,不需要健康检查,只检查容器是否运行
|
||||
if (serviceName == 'viewsh-module-iot-gateway') {
|
||||
sh """
|
||||
ssh ${sshOpts} root@${env.DEPLOY_HOST} '
|
||||
if docker ps | grep -q ${containerName}; then
|
||||
echo "✅ ${serviceName} is running (lightweight gateway)"
|
||||
else
|
||||
echo "❌ ${serviceName} is not running"
|
||||
docker logs --tail 50 ${containerName} 2>/dev/null || true
|
||||
exit 1
|
||||
fi
|
||||
'
|
||||
"""
|
||||
return
|
||||
}
|
||||
|
||||
sh """
|
||||
ssh ${sshOpts} root@${env.DEPLOY_HOST} '
|
||||
STATUS=\$(docker inspect --format="{{.State.Health.Status}}" ${containerName} 2>/dev/null || echo "not_found")
|
||||
|
||||
Reference in New Issue
Block a user