Files
pipeline-scripts/chuanqi_server_pro_jenkins
aixianling 6e90cba614 build(chuanqi_server_pro_jenkins): 更新 Jenkins 部署配置
- 移除原有的 sshagent 方式
- 使用 sshPublisher 插件进行远程服务器部署
- 配置详细的远程服务器信息和执行命令
2025-02-18 15:07:44 +08:00

36 lines
1.2 KiB
Plaintext

pipeline {
agent any
stages {
stage('部署') {
steps {
echo 'Deploying...'
sshPublisher(publishers: [sshPublisherDesc(configName: 'huawei68',
transfers: [sshTransfer(
sourceFiles: '',
execCommand: 'cd /mnt/data/docker/chuanqi-server-instance&&git pull',
remoteDirectory: '.')
], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: true)
])
// sh 'docker restart chuanqi-server-logic'
}
}
}
post {
success {
echo 'Deployment finished successfully.'
sh """
curl 'https://api.telegram.org/bot7816434196:AAFtmbUYpUIwcb_SvBnJY0guPIOLCxp2a5s/sendMessage' \\
-x http://192.168.25.110:20171\\
-H 'Content-Type: application/json' \\
-d '{
"chat_id": "6779541681",
"text":"传奇服务端生产环境(pro)构建完成!",
}'
"""
}
failure {
echo 'Deployment failed.'
}
}
}