Move docs and gallery deployment to Cirrus, add Docker image for Linux (#20097)

This adds a Docker image for the linux builds, replacing a lot of the setup code with a Docker build.

Added a docker image build step that has the right gcloud credentials in it.

Also, this finally moves the gallery deployment and docs publishing steps to Cirrus. They were dependent upon some environment setup that was a lot easier to do in Docker than in a setup bash script.
This commit is contained in:
Greg Spencer
2018-08-03 17:28:34 -07:00
committed by GitHub
parent 75960f35d4
commit a5c2ddddaa
10 changed files with 367 additions and 42 deletions

77
dev/bots/deploy_gallery.sh Executable file
View File

@@ -0,0 +1,77 @@
#!/bin/bash
set -e
function script_location() {
local script_location="${BASH_SOURCE[0]}"
# Resolve symlinks
while [[ -h "$script_location" ]]; do
DIR="$(cd -P "$(dirname "$script_location")" >/dev/null && pwd)"
script_location="$(readlink "$script_location")"
[[ "$script_location" != /* ]] && script_location="$DIR/$script_location"
done
echo "$(cd -P "$(dirname "$script_location")" >/dev/null && pwd)"
}
# So that users can run this script locally from any directory and it will work as
# expected.
SCRIPT_LOCATION="$(script_location)"
FLUTTER_ROOT="$(dirname "$(dirname "$SCRIPT_LOCATION")")"
export PATH="$FLUTTER_ROOT/bin:$FLUTTER_ROOT/bin/cache/dart-sdk/bin:$PATH"
set -x
cd "$FLUTTER_ROOT"
if [[ "$SHARD" = "deploy_gallery" ]]; then
version="$(<version)"
if [[ "$OS" == "linux" ]]; then
echo "Building Flutter Gallery $version for Android..."
export ANDROID_HOME="$PWD/android-sdk"
(
cd examples/flutter_gallery
flutter build apk --release -t lib/main_publish.dart
)
echo "Android Flutter Gallery built"
if [[ -z "$CIRRUS_PULL_REQUEST" && "$CIRRUS_BRANCH" == "dev" && "$version" != *"pre"* ]]; then
echo "Deploying Flutter Gellery $version to Play Store..."
(
cd examples/flutter_gallery/android
bundle install
bundle exec fastlane deploy_play_store
)
else
echo "Not deployed: Flutter Gallery is only deployed to the Play Store on merged and tagged dev branch commits"
fi
elif [[ "$OS" == "macos" ]]; then
echo "Building Flutter Gallery $version for iOS..."
(
cd examples/flutter_gallery
flutter build ios --release --no-codesign -t lib/main_publish.dart
)
echo "iOS Flutter Gallery built"
if [[ -z "$CIRRUS_PULL_REQUEST" ]]; then
if [[ "$CIRRUS_BRANCH" == "dev" && "$version" != *"pre"* ]]; then
echo "Archiving with distribution profile and deploying to TestFlight..."
(
cd examples/flutter_gallery/ios
bundle install
bundle exec fastlane build_and_deploy_testflight upload:true
)
else
echo "Archiving with distribution profile..."
(
cd examples/flutter_gallery/ios
bundle install
bundle exec fastlane build_and_deploy_testflight
)
echo "Archive is only deployed to TestFlight on tagged dev branch commits"
fi
else
echo "Not deployed: Flutter Gallery is only deployed to TestFlight on merged and tagged dev branch commits"
fi
fi
else
echo "Doing nothing: not on the 'deploy_gallery' SHARD."
fi