Files
pipeline-scripts/chuanqi_web_pro_jenkins
kubbo 8d41bb95cc build(deploy): 更新传棋项目部署配置
- 修改服务器配置名称:将 'huawei68' 和 'tencent-SG' 更改为 'chuanqi-xi'
- 更新部署路径:将 '/mnt/data/docker/' 和 '/home/chuanqi/' 更改为 '/opt/chuanqi/'
- 调整 chuanqi_web_pro_jenkins 中的 remoteDirectory 参数
2025-04-17 15:46:28 +08:00

54 lines
2.0 KiB
Plaintext

pipeline {
agent any
stages {
stage('拉取代码') {
steps {
checkout([
$class: 'GitSCM',
branches: [[name: '*/main']],
doGenerateSubmoduleConfigurations: false,
extensions: [],
submoduleCfg: [],
userRemoteConfigs: [[url: 'http://192.168.25.110:8999/kubbo/chuanqi-client-config.git',credentialsId:'d54e1035-acca-424e-80d0-9f7e29cab9c3']]
])
}
}
stage('打包') {
steps {
echo "正在打包的工程==>: ${params.pid}"
sh "npm i"
sh "npm run deploy"
}
}
stage('部署') {
steps {
echo 'Deploying...'
sshPublisher(publishers: [sshPublisherDesc(configName: 'chuanqi-xi',
transfers: [sshTransfer(
sourceFiles: "dist.zip",
execCommand: "cd /opt/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/chuanqi/web")
], 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.'
}
}
}