forked from firka/flutter
Remove Travis configuration from flutter/flutter (#20288)
This removes the final traces of Travis and Appveyor from the Flutter tree. I've updated the documentation and fixed a couple of places where scripts look for Travis, and eliminated the dart tools runningOnTravis function (which was unused anyhow). There are places in the flutter script that used to look for the environment variable TRAVIS. We actually do want to continue to detect that we're running on Travis there, since in the plugins repo we still use Travis (for the moment). In any case, it's OK, because the CI environment variable is set on all of the CI bots (Cirrus, Travis, and Appveyor). FastLane doesn't have a setup_cirrus equivalent to setup_travis, but it actually doesn't matter there either, since it doesn't do Travis-specific things, and it also looks for the CI environment variable.
This commit is contained in:
18
bin/flutter
18
bin/flutter
@@ -85,16 +85,16 @@ function upgrade_flutter () {
|
||||
fi
|
||||
|
||||
local revision="$(cd "$FLUTTER_ROOT"; git rev-parse HEAD)"
|
||||
if [[ ! -f "$SNAPSHOT_PATH" ]] || [[ ! -s "$STAMP_PATH" ]] || [[ "$(cat "$STAMP_PATH")" != "$revision" ]] || [[ "$FLUTTER_TOOLS_DIR/pubspec.yaml" -nt "$FLUTTER_TOOLS_DIR/pubspec.lock" ]]; then
|
||||
if [[ ! -f "$SNAPSHOT_PATH" || ! -s "$STAMP_PATH" || "$(cat "$STAMP_PATH")" != "$revision" || "$FLUTTER_TOOLS_DIR/pubspec.yaml" -nt "$FLUTTER_TOOLS_DIR/pubspec.lock" ]]; then
|
||||
rm -f "$FLUTTER_ROOT/version"
|
||||
touch "$FLUTTER_ROOT/bin/cache/.dartignore"
|
||||
"$FLUTTER_ROOT/bin/internal/update_dart_sdk.sh"
|
||||
VERBOSITY=--verbosity=error
|
||||
VERBOSITY="--verbosity=error"
|
||||
|
||||
echo Building flutter tool...
|
||||
if [[ "$TRAVIS" == "true" ]] || [[ "$BOT" == "true" ]] || [[ "$CONTINUOUS_INTEGRATION" == "true" ]] || [[ "$CHROME_HEADLESS" == "1" ]] || [[ "$APPVEYOR" == "true" ]] || [[ "$CI" == "true" ]]; then
|
||||
if [[ "$CI" == "true" || "$BOT" == "true" || "$CONTINUOUS_INTEGRATION" == "true" || "$CHROME_HEADLESS" == "1" ]]; then
|
||||
PUB_ENVIRONMENT="$PUB_ENVIRONMENT:flutter_bot"
|
||||
VERBOSITY=--verbosity=all
|
||||
VERBOSITY="--verbosity=all"
|
||||
fi
|
||||
export PUB_ENVIRONMENT="$PUB_ENVIRONMENT:flutter_install"
|
||||
|
||||
@@ -104,8 +104,8 @@ function upgrade_flutter () {
|
||||
|
||||
while : ; do
|
||||
cd "$FLUTTER_TOOLS_DIR"
|
||||
"$PUB" upgrade $VERBOSITY --no-packages-dir && break
|
||||
echo Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds...
|
||||
"$PUB" upgrade "$VERBOSITY" --no-packages-dir && break
|
||||
echo "Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds..."
|
||||
sleep 5
|
||||
done
|
||||
"$DART" --snapshot="$SNAPSHOT_PATH" --packages="$FLUTTER_TOOLS_DIR/.packages" "$SCRIPT_PATH"
|
||||
@@ -132,7 +132,7 @@ DART="$DART_SDK_PATH/bin/dart"
|
||||
PUB="$DART_SDK_PATH/bin/pub"
|
||||
|
||||
# Test if running as superuser – but don't warn if running within Docker
|
||||
if [[ "$EUID" == "0" ]] && ! [[ -f /.dockerenv ]]; then
|
||||
if [[ "$EUID" == "0" && ! -f /.dockerenv ]]; then
|
||||
echo " Woah! You appear to be trying to run flutter as root."
|
||||
echo " We strongly recommend running the flutter tool without superuser privileges."
|
||||
echo " /"
|
||||
@@ -160,12 +160,14 @@ fi
|
||||
(upgrade_flutter) 3< "$PROG_NAME"
|
||||
|
||||
set +e
|
||||
# FLUTTER_TOOL_ARGS isn't quoted below, because it is meant to be considered as
|
||||
# separate space-separated args.
|
||||
"$DART" $FLUTTER_TOOL_ARGS "$SNAPSHOT_PATH" "$@"
|
||||
|
||||
# The VM exits with code 253 if the snapshot version is out-of-date.
|
||||
# If it is, we need to snapshot it again.
|
||||
EXIT_CODE=$?
|
||||
if [[ $EXIT_CODE -ne 253 ]]; then
|
||||
if [[ $EXIT_CODE != 253 ]]; then
|
||||
exit $EXIT_CODE
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user