Prepare to auto cloud build flutter dashboard (#831)

* add cloud build

* add license

* license fix

* add prod & staging

* add > /dev/null

* add flutter doctor

* change staging to stage
diff --git a/cloud_build/app_build.sh b/cloud_build/app_build.sh
new file mode 100644
index 0000000..40fabc3
--- /dev/null
+++ b/cloud_build/app_build.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+# Copyright 2020 The Flutter Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# Build old angular dart app to generate flutter benchmark dashboard.
+
+pushd app > /dev/null
+rm -rf build
+flutter pub get
+flutter pub run build_runner build --release --output build --delete-conflicting-outputs
+cp -rn build/web ../app_dart/build/
+flutter clean
+popd > /dev/null
\ No newline at end of file
diff --git a/cloud_build/app_flutter_build.sh b/cloud_build/app_flutter_build.sh
new file mode 100644
index 0000000..8ca103f
--- /dev/null
+++ b/cloud_build/app_flutter_build.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+# Copyright 2020 The Flutter Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# Build flutter app to generate flutter build dashboard.
+
+pushd app_flutter > /dev/null
+rm -rf build
+flutter doctor
+flutter pub get
+flutter config --enable-web
+flutter build web --dart-define FLUTTER_WEB_USE_SKIA=true
+rm -rf ../app_dart/build
+cp -r build ../app_dart/build
+flutter clean
+popd > /dev/null
diff --git a/cloud_build/deploy.sh b/cloud_build/deploy.sh
new file mode 100644
index 0000000..336b5d2
--- /dev/null
+++ b/cloud_build/deploy.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+# Copyright 2020 The Flutter Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# Deploy a new flutter dashboard version to google cloud.
+
+pushd app_dart > /dev/null
+gcloud app deploy --project "$1" --version "version-$2" --no-promote --no-stop-previous-version
+popd > /dev/null
\ No newline at end of file
diff --git a/cloud_build_prod.yaml b/cloud_build_prod.yaml
new file mode 100644
index 0000000..5c5d0ef
--- /dev/null
+++ b/cloud_build_prod.yaml
@@ -0,0 +1,21 @@
+# Provide instructions for google Cloud Build to auto-build flutter
+# dashboard to flutter-dashboard project. Auto-build will be triggered
+# by new commits to `master` branch.
+
+steps:
+
+  # Build app_flutter.
+  - name: gcr.io/flutter-dashboard/flutter
+    entrypoint: '/bin/bash'
+    args: ['cloud_build/app_flutter_build.sh']
+
+  # Build angular dart app.
+  - name: gcr.io/flutter-dashboard/flutter
+    entrypoint: '/bin/bash'
+    args: ['cloud_build/app_build.sh']
+
+  # Deploy a new version to google cloud.
+  - name: 'gcr.io/cloud-builders/gcloud'
+    entrypoint: '/bin/bash'
+    args: ['cloud_build/deploy.sh', 'flutter-dashboard', '$SHORT_SHA']
+
diff --git a/cloud_build_stage.yaml b/cloud_build_stage.yaml
new file mode 100644
index 0000000..447045e
--- /dev/null
+++ b/cloud_build_stage.yaml
@@ -0,0 +1,21 @@
+# Provide instructions for google Cloud Build to auto-build flutter
+# dashboard to flutter-dashboard project. Auto-build will be triggered
+# by new commits to `master` branch.
+
+steps:
+
+  # Build app_flutter.
+  - name: gcr.io/flutter-dashboard-stage/flutter
+    entrypoint: '/bin/bash'
+    args: ['cloud_build/app_flutter_build.sh']
+
+  # Build angular dart app.
+  - name: gcr.io/flutter-dashboard-stage/flutter
+    entrypoint: '/bin/bash'
+    args: ['cloud_build/app_build.sh']
+
+  # Deploy a new version to google cloud.
+  - name: 'gcr.io/cloud-builders/gcloud'
+    entrypoint: '/bin/bash'
+    args: ['cloud_build/deploy.sh', 'flutter-dashboard-stage', '$SHORT_SHA']
+