Files
vless-api/pipeline
aixianling 5d36226b02 ci: 更新 vless-api 部署流程
- 在 git pull 后添加 docker restart vless-api 命令
- 优化了远程执行命令,确保服务在代码更新后重启
2025-02-25 13:58:35 +08:00

35 lines
1.2 KiB
Plaintext

pipeline {
agent any
stages {
stage('部署') {
steps {
echo 'Deploying...'
sshPublisher(publishers: [sshPublisherDesc(configName: 'lsw-vpn',
transfers: [sshTransfer(
sourceFiles: "",
execCommand: "cd /opt/vless-api&&git pull&docker restart vless-api",
remoteDirectory: "/opt/vless-api")
], 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":"传奇web生产环境(pro)构建完成!",
// }'
// """
// }
// failure {
// echo 'Deployment failed.'
// }
// }
}