fix: iot-gateway去除健康检查、nacos配置
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled

This commit is contained in:
lzh
2026-01-14 17:48:00 +08:00
parent 244c8aee96
commit bcbbde1879
5 changed files with 38 additions and 53 deletions

35
Jenkinsfile vendored
View File

@@ -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")