我的 flutter 应用程序的 XCode Cloud 构建突然开始失败,而我没有对其进行任何预期的更改。
以下是我的
ci_post_clone.sh
脚本。
echo "Starting CI script..."
echo $CI_WORKSPACE
# The default execution directory of this script is the ci_scripts directory.
cd $CI_WORKSPACE # change working directory to the root of your cloned repo.
ls
# Install Flutter using git.
git clone https://github.com/flutter/flutter.git --depth 1 -b stable $HOME/flutter
export PATH="$PATH:$HOME/flutter/bin"
# Install Flutter artifacts for iOS (--ios), or macOS (--macos) platforms.
flutter precache --ios
# Install Flutter dependencies.
flutter pub get
# Install CocoaPods using Homebrew.
HOMEBREW_NO_AUTO_UPDATE=1 # disable homebrew's automatic updates.
brew install cocoapods
cd ios && pod install # run `pod install` in the `ios` directory.
flutter build ios
echo $CI_WORKSPACE
中的行仅记录一个空行,因此看来该变量未设置/为空。因此以下命令无法执行。
但是,我不明白为什么这个变量是空的? CI_WORKSPACE 是如何设置的以及如何修复它以便它再次具有克隆存储库的位置?
不幸的是,它现在似乎被删除了。 :( 我认为最好使用 CI_PRIMARY_REPOSITORY_PATH 而不是 CI_WORKSPACE https://developer.apple.com/documentation/xcode/environment-variable-reference