flutter_flutter/dev/bots/travis_script.sh
xster 5b46e0a4be
Let Travis build the gallery and push to TestFlight / Play Store (#14408)
* iOS works

* Works on Android

* Take in commit number in iOS also. Get rid of image upload for Android. It's just a waste of bandwidth

* Tweak to fix on Travis
2018-02-05 12:00:24 -08:00

39 lines
1.5 KiB
Bash
Executable File

#!/bin/bash
set -ex
export PATH="$PWD/bin:$PWD/bin/cache/dart-sdk/bin:$PATH"
if [ "$SHARD" = "build_and_deploy_gallery" ]; then
echo "Building and deploying Flutter Gallery"
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
echo "Building Flutter Gallery for Android..."
export ANDROID_HOME=`pwd`/android-sdk
(cd examples/flutter_gallery; flutter build apk --release)
echo "Android Flutter Gallery built"
if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then # TODO(xster): add back && [ "$TRAVIS_BRANCH" = "dev" ] after testing
echo "Deploying to Play Store..."
(cd examples/flutter_gallery/android; bundle exec fastlane deploy_play_store)
else
echo "Flutter Gallery is only deployed to the Play Store on merged dev branch commits"
fi
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
echo "Building Flutter Gallery for iOS..."
(cd examples/flutter_gallery; flutter build ios --release --no-codesign)
echo "iOS Flutter Gallery built"
if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then # TODO(xster): add back && [ "$TRAVIS_BRANCH" = "dev" ] after testing
echo "Re-building with distribution profile and deploying to TestFlight..."
(cd examples/flutter_gallery/ios; bundle exec fastlane build_and_deploy_testflight)
else
echo "Flutter Gallery is only deployed to the TestFlight on merged dev branch commits"
fi
fi
elif [ "$SHARD" = "docs" ]; then
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
# Generate the API docs, upload them
./dev/bots/docs.sh
fi
else
dart ./dev/bots/test.dart
fi