修改ios dev groove

main
SunChengyong 2026-04-22 14:56:52 +08:00
parent 51bf3ff799
commit 3c2cf04f65
1 changed files with 42 additions and 9 deletions

View File

@ -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)