- 修改服务器配置名称:将 'huawei68' 和 'tencent-SG' 更改为 'chuanqi-xi' - 更新部署路径:将 '/mnt/data/docker/' 和 '/home/chuanqi/' 更改为 '/opt/chuanqi/' - 调整 chuanqi_web_pro_jenkins 中的 remoteDirectory 参数
35 lines
1.2 KiB
Plaintext
35 lines
1.2 KiB
Plaintext
pipeline {
|
|
agent any
|
|
stages {
|
|
stage('部署') {
|
|
steps {
|
|
echo 'Deploying...'
|
|
sshPublisher(publishers: [sshPublisherDesc(configName: 'chuanqi-xi',
|
|
transfers: [sshTransfer(
|
|
sourceFiles: '',
|
|
execCommand: 'cd /opt/chuanqi/chuanqi-server-instance&&git pull&&docker restart chuanqi-server-logic',
|
|
remoteDirectory: '.')
|
|
], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: true)
|
|
])
|
|
}
|
|
}
|
|
}
|
|
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.'
|
|
}
|
|
}
|
|
}
|