更新jenkins脚本

main
zhangaotian 2025-11-21 13:53:52 +08:00
parent a3878e4e55
commit fc87d88b5c
1 changed files with 16 additions and 3 deletions

View File

@ -9,6 +9,7 @@ def DEV_PARAM = true
def CHANNEL_PARAM = params.Channel
def DEBUGBUILD_PARAM = params.DebugBuild
def HOTUPDATE_PARAM = params.Enable_Hot_Update
def OBFUZ = params.Obfuz
// Jenkins
def ARTIFACT_URL = "http://${env.PHXH_BUILDER_IP_ADDRESS}:8080/job/${env.JOB_NAME}/"
@ -206,25 +207,37 @@ pipeline {
if(params.Debug_AllLocal == true)
PROFILE_PARAM="AllLocal"
// Groovy \"\"
if(params.Build_InitApp == false){
build_result=sh(script: "$WORKSPACE/Tool/build_tools/hot_update.sh ${VERSION_PARAM} ${PLATFORM_PARAM} ${PROFILE_PARAM} ${CHANNEL_PARAM} ${HOTUPDATE_PARAM}", returnStatus: true, returnStdout: false)
build_result=sh(script: "$WORKSPACE/Tool/build_tools/hot_update.sh ${VERSION_PARAM} ${PLATFORM_PARAM} ${PROFILE_PARAM} ${CHANNEL_PARAM} ${HOTUPDATE_PARAM} ${DEBUGBUILD_PARAM} \"\" \"\" ${OBFUZ}", returnStatus: true, returnStdout: false)
log_path="$BUILD_PATH/UpdatePreviousBuild.log"
}
else
build_result=sh(script: "$WORKSPACE/Tool/build_tools/build_unity.sh ${VERSION_PARAM} ${PLATFORM_PARAM} ${PROFILE_PARAM} ${CHANNEL_PARAM} ${HOTUPDATE_PARAM} ${DEBUGBUILD_PARAM} ${AAB_PARAM} ${DEV_PARAM}", returnStatus: true, returnStdout: false)
build_result=sh(script: "$WORKSPACE/Tool/build_tools/build_unity.sh ${VERSION_PARAM} ${PLATFORM_PARAM} ${PROFILE_PARAM} ${CHANNEL_PARAM} ${HOTUPDATE_PARAM} ${DEBUGBUILD_PARAM} ${AAB_PARAM} ${DEV_PARAM} \"\" \"\" ${OBFUZ} \"\"", returnStatus: true, returnStdout: false)
def parse_log = "../../$log_path"
//
if(build_result != 0)
{
//
archiveArtifacts artifacts: "$log_path" , followSymlinks: false
def parse_log = "../../$log_path"
ParseBuildLogError(parse_log)
def message = "【${PLATFORM_PARAM}】【${VERSION_PARAM}】【Debug】【${CHANNEL_PARAM}】构建失败"
SendMessageToWechat(message)
error("Failure of the '打包' stage")
}
else{
sh "chmod +x $WORKSPACE/Tool/build_tools/check_unity_build_result.sh"
def check_result = sh(script: "sh $WORKSPACE/Tool/build_tools/check_unity_build_result.sh ${parse_log}", returnStatus: true)
if (check_result != 0) {
//
archiveArtifacts artifacts: "$log_path" , followSymlinks: false
def message = "【${PLATFORM_PARAM}】【${VERSION_PARAM}】【Debug】【${CHANNEL_PARAM}】构建失败 日志捕捉到 Build Finished, Result: Failure."
SendMessageToWechat(message)
error("Failure of the '打包' stage")
}
}
}
}
}