Forest_Client/Tool/BuildTool/upload_ipa.sh

37 lines
776 B
Bash
Raw Normal View History

2024-06-12 15:01:54 +08:00
SHELL_DIR=$(dirname $0)
echo "change dir to $SHELL_DIR"
cd "$SHELL_DIR"
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"
2024-07-31 16:37:34 +08:00
WORKSPACE="$3"
2024-06-12 15:01:54 +08:00
2024-07-31 16:37:34 +08:00
REMOTE_PATH="$REMOTE_UPLOAD_PATH/$WORKSPACE/$PLATFORM/$VERSION/"
echo "upload folder is: ${REMOTE_PATH}"
2024-06-12 15:01:54 +08:00
2024-07-31 16:37:34 +08:00
IAP_NAME="$BUILD_NAME.ipa"
2024-06-12 15:01:54 +08:00
ssh "$REMOTE_USER@$REMOTE_HOST" "mkdir -p $REMOTE_PATH"
scp nld_self_host_ipa.plist "$REMOTE_USER@$REMOTE_HOST:$REMOTE_PATH"
cd "../../Builds/$PLATFORM/$VERSION/"
2024-07-31 16:37:34 +08:00
scp "${IAP_NAME}" "$REMOTE_USER@$REMOTE_HOST:$REMOTE_PATH"
2024-06-12 15:01:54 +08:00
upload_result=$?
if [ $upload_result -eq 0 ]; then
echo "ipa uploaded to remote server successfully."
else
echo "Failed to upload ipa to remote server."
2024-07-31 16:37:34 +08:00
fi