2024-06-12 15:01:54 +08:00
|
|
|
##!/bin/bash
|
|
|
|
SHELL_DIR=$(dirname $0)
|
|
|
|
echo "change dir to $SHELL_DIR"
|
|
|
|
cd "$SHELL_DIR"
|
|
|
|
|
|
|
|
# Source the local environment
|
|
|
|
if [ -f ./local_env.sh ]; then
|
|
|
|
source ./local_env.sh
|
|
|
|
echo "found the local_env file"
|
|
|
|
fi
|
|
|
|
|
2024-07-31 16:37:34 +08:00
|
|
|
# 获取项目相关参数
|
|
|
|
if [ -f ./project_env.sh ]; then
|
|
|
|
source ./project_env.sh
|
|
|
|
echo "found the project_env file"
|
|
|
|
fi
|
|
|
|
|
2024-06-12 15:01:54 +08:00
|
|
|
VERSION="$1"
|
|
|
|
PLATFORM="$2"
|
|
|
|
PROFILE="$3"
|
|
|
|
CHANNEL="$4"
|
|
|
|
ENABLE_HOT_UPDATE="$5"
|
|
|
|
ARTIFACT_URL="$6"
|
|
|
|
|
|
|
|
|
|
|
|
# Set if needs to clear cache
|
|
|
|
CLEARCACHED="yes"
|
|
|
|
#CLEARCACHED="no"
|
|
|
|
|
|
|
|
BUILD_FOLDER="../../Builds/$PLATFORM/$VERSION" #相对脚本路径
|
|
|
|
EXECUTE_METHOD="BatchBuild.UpdatePreviousBuild"
|
|
|
|
LOG_FILE="$BUILD_FOLDER/UpdatePreviousBuild.log" #相对脚本路径
|
|
|
|
|
|
|
|
echo "Start update previous building ... ..."
|
|
|
|
|
2024-07-31 16:37:34 +08:00
|
|
|
"$UNITY_PATH" -quit -batchmode -projectPath "../../$PROJECT_NAME" -executeMethod "$EXECUTE_METHOD" \
|
2024-06-12 15:01:54 +08:00
|
|
|
-platform "$PLATFORM" \
|
|
|
|
-profile "$PROFILE" \
|
2024-07-31 16:37:34 +08:00
|
|
|
-appVersion "$VERSION" \
|
2024-06-12 15:01:54 +08:00
|
|
|
-clearCached "$CLEARCACHED" \
|
|
|
|
-channel "$CHANNEL" \
|
|
|
|
-enableHotUpdate "$ENABLE_HOT_UPDATE" \
|
|
|
|
-logFile "$LOG_FILE"
|
|
|
|
|
|
|
|
build_result=$?
|
|
|
|
|
|
|
|
if [ $build_result -ne 0 ]; then
|
|
|
|
echo "Update build failed. Check the log for details."
|
|
|
|
sh to_inner_wechat_robot.sh "【$PLATFORM】【$VERSION】【$PROFILE】Failed to Update a previous build Addressable, Check the log for details:$ARTIFACT_URL"
|
2024-07-31 16:37:34 +08:00
|
|
|
sh collect_and_send_error.sh $LOG_FILE
|
2024-06-12 15:01:54 +08:00
|
|
|
exit 1
|
|
|
|
else
|
|
|
|
echo " Update a previous build successful! !"
|
|
|
|
fi
|