flutter/dev/bots/cirrus_setup.sh
Greg Spencer 01d6444490
Switch from infinite retries on upgrade to 10 retries. (#20450)
This changes the flutter tool to just try 10 times before giving up when running "flutter upgrade". Infinite retries can hang bots, and really don't provide a lot of help: if we've failed to upgrade for for nearly a minute, trying every five seconds, then something is just not responding.

Also, changed the bot default warning level to "normal" from "all", because the solver messages are VERY verbose: several megs of output for doing packages get on Flutter. "normal" will give warnings, user messages and errors, which should be sufficient to diagnose problems on the bots without spamming the log.

I removed the retrying for building the snapshot on flutter.bat because we don't do that on the other platforms, and because I can't imagine how running it again would give a different answer.

I also fixed a problem in the whitespace detection when no files matched the type of file that it is looking for, and removed the code that waits until failure to print the logs on setup, since reducing the log output made a huge difference.
2018-08-11 19:10:14 -07:00

32 lines
872 B
Bash
Executable file

#!/bin/bash
set -e
function error() {
echo "$@" 1>&2
}
# This script is only meant to be run by the Cirrus CI system, not locally.
# It must be run from the root of the Flutter repo.
function accept_android_licenses() {
yes "y" | flutter doctor --android-licenses > /dev/null 2>&1
}
echo "Flutter SDK directory is: $PWD"
# Run flutter to download dependencies and precompile things, and to disable
# analytics on the bots.
echo "Downloading build dependencies and pre-compiling Flutter snapshot"
./bin/flutter config --no-analytics
# Run doctor, to print it to the log for debugging purposes.
./bin/flutter doctor -v
# Accept licenses.
echo "Accepting Android licenses."
accept_android_licenses || (error "Accepting Android licenses failed." && false)
# Run pub get in all the repo packages.
echo "Updating packages for Flutter."
./bin/flutter update-packages