修改ios dev groove
parent
51bf3ff799
commit
3c2cf04f65
|
|
@ -31,10 +31,27 @@ def PROJECT_NAME = "Unity-iPhone"
|
|||
def SCHEME_NAME = "Unity-iPhone"
|
||||
|
||||
def GetRemote(){
|
||||
/*if('BilibiliDev' == params.Channel)
|
||||
return 'bilibili';
|
||||
else*/
|
||||
return 'dev_ios';
|
||||
if('iOS' == params.Channel)
|
||||
return 'dev';
|
||||
if('Dev_iOS' == params.Channel)
|
||||
return 'dev_ios';
|
||||
else
|
||||
return params.Channel;
|
||||
}
|
||||
|
||||
def CheckRemoteBranchExists(repoUrl, branchName) {
|
||||
def result = sh(
|
||||
script: "git ls-remote --heads ${repoUrl} refs/heads/${branchName}",
|
||||
returnStdout: true
|
||||
).trim()
|
||||
|
||||
if (result == '') {
|
||||
echo "警告: 远程分支 ${branchName} 不存在于 ${repoUrl}"
|
||||
return false
|
||||
}
|
||||
|
||||
echo "远程分支 ${branchName} 存在"
|
||||
return true
|
||||
}
|
||||
|
||||
def SendMessageToWechat(message){
|
||||
|
|
@ -76,7 +93,7 @@ pipeline {
|
|||
try {
|
||||
def currentPath = sh(script: 'pwd', returnStdout: true).trim()
|
||||
echo "cd ${currentPath}"
|
||||
|
||||
|
||||
// 1. 还原子模块修改
|
||||
def gitDirExists = sh(script: '[ -d ".git" ] && echo "true" || echo "false"', returnStdout: true).trim()
|
||||
def scriptPathExists = fileExists("${WORKSPACE}/Tool/build_tools/git_revert_modules_modification.sh")
|
||||
|
|
@ -86,7 +103,16 @@ pipeline {
|
|||
}
|
||||
|
||||
// 2. 拉取主项目代码
|
||||
def repoUrl = 'http://1.14.122.170:3000/PHXH/NLDClient.git'
|
||||
def remote = GetRemote();
|
||||
echo "获取到分支名字:${remote}"
|
||||
// 检查远程分支是否存在
|
||||
if (!CheckRemoteBranchExists(repoUrl, remote)) {
|
||||
def message = "【${PLATFORM_PARAM}】【${VERSION_PARAM}】【Debug】【${CHANNEL_PARAM}】远程分支 ${remote} 不存在,使用默认分支 dev"
|
||||
SendMessageToWechat(message)
|
||||
remote = 'dev' // 回退到默认分支
|
||||
}
|
||||
|
||||
echo "拉取分支:${remote}"
|
||||
checkout scmGit(
|
||||
branches: [[name: "*/${remote}"]],
|
||||
|
|
@ -96,7 +122,7 @@ pipeline {
|
|||
cloneOption(noTags: false, reference: '', shallow: false, timeout: 120),
|
||||
submodule(recursiveSubmodules: true, reference: '', timeout: 1200)
|
||||
],
|
||||
userRemoteConfigs: [[url: 'http://1.14.122.170:3000/PHXH/NLDClient.git' ]]
|
||||
userRemoteConfigs: [[url: repoUrl]]
|
||||
)
|
||||
|
||||
// 3. 删除旧 GamePlay_Dll 文件夹
|
||||
|
|
@ -105,10 +131,17 @@ pipeline {
|
|||
|
||||
// 4. 拉取 GamePlay 仓库
|
||||
def gameplayTargetPath = "${WORKSPACE}/ProjectNLD/Assets/Code/Scripts/GamePlay"
|
||||
def gameplayPath = "http://1.14.122.170:3000/PHXH/GamePlay.git"
|
||||
def gameplayUrl = "http://1.14.122.170:3000/PHXH/GamePlay.git"
|
||||
def branch = GetRemote();
|
||||
// 检查远程分支是否存在
|
||||
if (!CheckRemoteBranchExists(gameplayUrl, branch)) {
|
||||
def message = "【${PLATFORM_PARAM}】【${VERSION_PARAM}】【Debug】【${CHANNEL_PARAM}】远程分支 ${branch} 不存在,使用默认分支 dev"
|
||||
SendMessageToWechat(message)
|
||||
branch = 'dev' // 回退到默认分支
|
||||
}
|
||||
|
||||
sh "chmod +x ${WORKSPACE}/Tool/build_tools/git_pull_gameplay.sh"
|
||||
sh "$WORKSPACE/Tool/build_tools/git_pull_gameplay.sh ${gameplayTargetPath} ${gameplayPath} ${branch}"
|
||||
sh "$WORKSPACE/Tool/build_tools/git_pull_gameplay.sh ${gameplayTargetPath} ${gameplayUrl} ${branch}"
|
||||
} catch (err) {
|
||||
def message = "【${PLATFORM_PARAM}】【${VERSION_PARAM}】【Debug】【${CHANNEL_PARAM}】拉最新工程失败"
|
||||
SendMessageToWechat(message)
|
||||
|
|
@ -151,7 +184,7 @@ pipeline {
|
|||
// python脚本: Tool/py_tools/PreHandle.py <sdk_path> <channel_path>
|
||||
sh "chmod +x $WORKSPACE/Tool/py_tools/PreHandle.py"
|
||||
// 使用 returnStatus 获取脚本的退出码
|
||||
def pythonResult = sh(script: "python3 $WORKSPACE/Tool/py_tools/PreHandle.py ${sdkPath} ${channelPath}", returnStatus: true)
|
||||
def pythonResult = sh(script: "python3 $WORKSPACE/Tool/py_tools/PreHandle.py ${sdkPath} ${channelPath} ${OBFUZ}", returnStatus: true)
|
||||
if (pythonResult != 0) {
|
||||
def message = "【${PLATFORM_PARAM}】【${VERSION_PARAM}】【Debug】【${CHANNEL_PARAM}】修改渠道文件夹失败: pythonResult=${pythonResult}"
|
||||
SendMessageToWechat(message)
|
||||
|
|
|
|||
Loading…
Reference in New Issue