feat: 统一开放接口网关微服务初始化工程 (OAuth2.0 + MCP + OpenAPI + Webhook)
This commit is contained in:
Vendored
+49
@@ -0,0 +1,49 @@
|
||||
pipeline {
|
||||
agent any
|
||||
|
||||
tools {
|
||||
maven 'Maven-3.8'
|
||||
jdk 'JDK17'
|
||||
}
|
||||
|
||||
environment {
|
||||
DEPLOY_PORT = '18082'
|
||||
APP_NAME = 'iot-open-gateway'
|
||||
DEPLOY_DIR = '/data/iot/gateway'
|
||||
JENKINS_NODE_COOKIE = 'dontKillMe'
|
||||
BUILD_ID = 'dontKillMe'
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Deploy & Run') {
|
||||
steps {
|
||||
sh '''
|
||||
echo "=== 启动 IOT 开放网关微服务 ==="
|
||||
mkdir -p "${DEPLOY_DIR}"
|
||||
|
||||
if [ -f "/data/iot/gateway/source/target/iot-open-gateway-1.0.0.jar" ]; then
|
||||
cp -f "/data/iot/gateway/source/target/iot-open-gateway-1.0.0.jar" "${DEPLOY_DIR}/${APP_NAME}.jar"
|
||||
fi
|
||||
|
||||
PID=$(lsof -ti:${DEPLOY_PORT} || true)
|
||||
if [ -n "$PID" ]; then
|
||||
echo "停止旧进程 $PID"
|
||||
kill -9 $PID || true
|
||||
sleep 2
|
||||
fi
|
||||
|
||||
export JENKINS_NODE_COOKIE=dontKillMe
|
||||
export BUILD_ID=dontKillMe
|
||||
nohup java -jar -Dspring.profiles.active=prod "${DEPLOY_DIR}/${APP_NAME}.jar" > "${DEPLOY_DIR}/${APP_NAME}.log" 2>&1 &
|
||||
|
||||
echo "后台启动中..."
|
||||
sleep 6
|
||||
lsof -i:${DEPLOY_PORT} || true
|
||||
echo "=== 网关健康检查 ==="
|
||||
curl -s http://127.0.0.1:${DEPLOY_PORT}/open/gateway/health || true
|
||||
echo ""
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user