After months of the same script working properly, all of sudden, as of last night, our ci_post_clone.sh
started failing with following error:
The ci_post_clone.sh is not executable and was run using zsh (default shell on macOS). To make sure your script runs correctly, make the file executable using `chmod +x` and add an appropriate shebang line.
Here's what I've done:
- Re-applied:
git update-index --chmod=+x ./ci_scripts/ci_post_clone.sh
; still failed to execute returning same error - I was using older flutter version so changed the flutter branch to
stable
- still same error.
App code builds fine in local Xcode!
APPRECIATE ANY HELP!
Here is the script.
#!/bin/sh
# ci_post_clone.sh
# Runner
#
#
set -e
echo "Running post clone script"
# 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.
# 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.
echo "Doing precache"
flutter precache --ios
echo "Installing cocoa pods"
# Install CocoaPods using Homebrew.
HOMEBREW_NO_AUTO_UPDATE=1 # disable homebrew's automatic updates.
brew install cocoapods
echo "calling pub get"
# Install Flutter dependencies.
flutter pub get
echo "executing pod install"
# Install CocoaPods dependencies.
cd ios && pod install # run `pod install` in the `ios` directory.
exit 0
I have ZERO idea why specifying the actual folder location of ios
actually works.
After much trial & error, I finally got it to work with the following amendment to standard ci_post_clone.sh script
echo "change to ios folder"
# Install Flutter dependencies.
cd /Volumes/workspace/repository/ios
pwd
echo "calling pub get"
flutter pub get
echo "installing pods'
pod install
Here is a snip of the OS & Xcode versions used: