更新jenkins脚本:因sdk打包失败归档构建日志

main
zhangaotian 2025-11-07 15:37:48 +08:00
parent e2a0b8cf95
commit 9d83183076
1 changed files with 9 additions and 3 deletions

View File

@ -27,10 +27,14 @@ def BUILD_PATH
def log_path def log_path
def GetRemote(){ def GetRemote(){
if('VinnyTest' == params.Channel)
return 'VinnyTest';
if('Zhanhui' == params.Channel) if('Zhanhui' == params.Channel)
return 'zhanhui'; return 'zhanhui';
if('Dev' == params.Channel) if('Dev' == params.Channel)
return 'main'; return 'main';
if('QA_Dev' == params.Channel)
return 'main';
else else
return params.Channel; return params.Channel;
} }
@ -239,11 +243,11 @@ pipeline {
PROFILE_PARAM="AllLocal" PROFILE_PARAM="AllLocal"
if(params.Build_InitApp == false){ 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} ${DEBUGBUILD_PARAM} ${ANDROIDKEYSTORE} ${ANDROIDKEYALIAS}", 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} ${ANDROIDKEYSTORE} ${ANDROIDKEYALIAS} ${OBFUZ}", returnStatus: true, returnStdout: false)
log_path="$BUILD_PATH/UpdatePreviousBuild.log" log_path="$BUILD_PATH/UpdatePreviousBuild.log"
} }
else 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} ${ANDROIDKEYSTORE} ${ANDROIDKEYALIAS} ${UPLOAD_SYMBOL}", 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} ${ANDROIDKEYSTORE} ${ANDROIDKEYALIAS} ${OBFUZ} ${UPLOAD_SYMBOL}", returnStatus: true, returnStdout: false)
def parse_log = "../../$log_path" def parse_log = "../../$log_path"
// //
@ -262,6 +266,8 @@ pipeline {
sh "chmod +x $WORKSPACE/Tool/build_tools/check_unity_build_result.sh" 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) def check_result = sh(script: "sh $WORKSPACE/Tool/build_tools/check_unity_build_result.sh ${parse_log}", returnStatus: true)
if (check_result != 0) { if (check_result != 0) {
//
archiveArtifacts artifacts: "$log_path" , followSymlinks: false
def message = "【${PLATFORM_PARAM}】【${VERSION_PARAM}】【Debug】【${CHANNEL_PARAM}】构建失败 日志捕捉到 Build Finished, Result: Failure." def message = "【${PLATFORM_PARAM}】【${VERSION_PARAM}】【Debug】【${CHANNEL_PARAM}】构建失败 日志捕捉到 Build Finished, Result: Failure."
SendMessageToWechat(message) SendMessageToWechat(message)
error("Failure of the '打包' stage") error("Failure of the '打包' stage")
@ -279,7 +285,7 @@ pipeline {
if(params.Upload_Incremental == true) if(params.Upload_Incremental == true)
{ {
def upload_incremental_result=0 def upload_incremental_result=0
def last_manifest_path="$WORKSPACE/ProjectNLD/ServerData/LastManifests" def last_manifest_path="$WORKSPACE/ProjectNLD/ServerData/LastManifests/${CHANNEL_PARAM}"
sh "chmod +x $WORKSPACE/Tool/build_tools/upload_incremental_oss.sh" sh "chmod +x $WORKSPACE/Tool/build_tools/upload_incremental_oss.sh"
upload_incremental_result = sh(script: "$WORKSPACE/Tool/build_tools/upload_incremental_oss.sh ${asset_path} ${upload_path} ${ASSETS_END_POINT_PARAM} ${last_manifest_path}", returnStatus: true, returnStdout: false) upload_incremental_result = sh(script: "$WORKSPACE/Tool/build_tools/upload_incremental_oss.sh ${asset_path} ${upload_path} ${ASSETS_END_POINT_PARAM} ${last_manifest_path}", returnStatus: true, returnStdout: false)
if(upload_incremental_result != 0) if(upload_incremental_result != 0)