From 9cca2cedf92e4debda0fbbf9a477287f11d45ba2 Mon Sep 17 00:00:00 2001 From: aixianling Date: Tue, 25 Feb 2025 11:16:38 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20=E6=B7=BB=E5=8A=A0=E8=85=BE=E8=AE=AF=20SG?= =?UTF-8?q?=20=E6=9C=8D=E5=8A=A1=E5=99=A8=E9=83=A8=E7=BD=B2=E7=AE=A1?= =?UTF-8?q?=E9=81=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 Jenkins 管道脚本,用于部署到腾讯 SG 服务器 - 包含部署阶段的步骤,如解压文件、移动文件、设置权限等 - 注释掉了 post 部署通知功能,保留了 Telegram 消息发送的代码示例 --- pipeline | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 pipeline diff --git a/pipeline b/pipeline new file mode 100644 index 0000000..1b0c1ba --- /dev/null +++ b/pipeline @@ -0,0 +1,34 @@ +pipeline { + agent any + stages { + stage('部署') { + steps { + echo 'Deploying...' + sshPublisher(publishers: [sshPublisherDesc(configName: 'tencent-SG', + transfers: [sshTransfer( + sourceFiles: "", + execCommand: "cd /home/chuanqi/web&&unzip -o dist.zip&&mv -f main.min_jocw9Tu2.js js/&&mv -f config.xml resource_Publish/cfg/&&mv -f gameEui.json resource/&&rm -rf dist.zip&&chmod +x -R .", + 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.' + // } + // } +}