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:
Greg Spencer
2018-08-07 13:41:33 -07:00
committed by GitHub
parent b0046b1811
commit e60087a1a7
19 changed files with 55 additions and 251 deletions

View File

@@ -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

View File

@@ -119,12 +119,10 @@ GOTO :after_subroutine
REM Makes changes to PUB_ENVIRONMENT only visible to commands within SETLOCAL/ENDLOCAL
SETLOCAL
SET VERBOSITY=--verbosity=error
IF "%TRAVIS%" == "true" GOTO on_bot
IF "%CI%" == "true" GOTO on_bot
IF "%BOT%" == "true" GOTO on_bot
IF "%CONTINUOUS_INTEGRATION%" == "true" GOTO on_bot
IF "%CHROME_HEADLESS%" == "1" GOTO on_bot
IF "%APPVEYOR%" == "true" GOTO on_bot
IF "%CI%" == "true" GOTO on_bot
GOTO not_on_bot
:on_bot
SET PUB_ENVIRONMENT=%PUB_ENVIRONMENT%:flutter_bot
@@ -135,7 +133,7 @@ GOTO :after_subroutine
IF EXIST "%pub_cache_path%" SET PUB_CACHE=%pub_cache_path%
)
:retry_pub_upgrade
CALL "%pub%" upgrade %VERBOSITY% --no-packages-dir
CALL "%pub%" upgrade "%VERBOSITY%" --no-packages-dir
IF "%ERRORLEVEL%" NEQ "0" (
ECHO Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds...
timeout /t 5 /nobreak