diff --git a/Tool/build_env/jenkins_iOS_dev.groovy b/Tool/build_env/jenkins_iOS_dev.groovy index 19c6730d6ee..120f1a4ad47 100644 --- a/Tool/build_env/jenkins_iOS_dev.groovy +++ b/Tool/build_env/jenkins_iOS_dev.groovy @@ -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") + } + } } } }