SHELL_DIR=$(dirname $0) echo "change dir to $SHELL_DIR" cd "$SHELL_DIR" # 获取项目相关参数 if [ -f ./project_env.sh ]; then source ./project_env.sh echo "found the project_env file" fi VERSION="$1" PLATFORM="$2" WORKSPACE="$3" REMOTE_PATH="$REMOTE_UPLOAD_PATH/$WORKSPACE/$PLATFORM/$VERSION/" echo "upload folder is: ${REMOTE_PATH}" IAP_NAME="$BUILD_NAME.ipa" 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/" scp "${IAP_NAME}" "$REMOTE_USER@$REMOTE_HOST:$REMOTE_PATH" upload_result=$? if [ $upload_result -eq 0 ]; then echo "ipa uploaded to remote server successfully." else echo "Failed to upload ipa to remote server." fi