Generate a robots.txt when generating docs for API site. (#24059)
This commit is contained in:
@@ -78,21 +78,22 @@ cp "$FLUTTER_ROOT/dev/docs/google2ed1af765c529f57.html" "$FLUTTER_ROOT/dev/docs/
|
|||||||
# Upload new API docs when running on Cirrus
|
# Upload new API docs when running on Cirrus
|
||||||
if [[ -n "$CIRRUS_CI" && -z "$CIRRUS_PR" ]]; then
|
if [[ -n "$CIRRUS_CI" && -z "$CIRRUS_PR" ]]; then
|
||||||
echo "This is not a pull request; considering whether to upload docs... (branch=$CIRRUS_BRANCH)"
|
echo "This is not a pull request; considering whether to upload docs... (branch=$CIRRUS_BRANCH)"
|
||||||
if [[ "$CIRRUS_BRANCH" == "master" || "$CIRRUS_BRANCH" == "beta" ]]; then
|
if [[ "$CIRRUS_BRANCH" == "master" ]]; then
|
||||||
if [[ "$CIRRUS_BRANCH" == "master" ]]; then
|
echo "Updating $CIRRUS_BRANCH docs: https://master-docs-flutter-io.firebaseapp.com/"
|
||||||
echo "Updating master docs: https://master-docs-flutter-io.firebaseapp.com/"
|
# Disable search indexing on the master staging site so searches get only
|
||||||
# Disable search indexing on the master staging site so searches get only
|
# the stable site.
|
||||||
# the beta site.
|
echo -e "User-agent: *\nDisallow: /" > "$FLUTTER_ROOT/dev/docs/doc/robots.txt"
|
||||||
echo -e "User-agent: *\nDisallow: /" > "$FLUTTER_ROOT/dev/docs/doc/robots.txt"
|
export FIREBASE_TOKEN="$FIREBASE_MASTER_TOKEN"
|
||||||
export FIREBASE_TOKEN="$FIREBASE_MASTER_TOKEN"
|
deploy 5 master-docs-flutter-io
|
||||||
deploy 5 master-docs-flutter-io
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "$CIRRUS_BRANCH" == "beta" ]]; then
|
if [[ "$CIRRUS_BRANCH" == "stable" ]]; then
|
||||||
echo "Updating beta docs: https://docs.flutter.io/"
|
# Enable search indexing on the master staging site so searches get only
|
||||||
export FIREBASE_TOKEN="$FIREBASE_PUBLIC_TOKEN"
|
# the stable site.
|
||||||
deploy 5 docs-flutter-io
|
echo "Updating $CIRRUS_BRANCH docs: https://docs.flutter.io/"
|
||||||
fi
|
echo -e "# All robots welcome!" > "$FLUTTER_ROOT/dev/docs/doc/robots.txt"
|
||||||
|
export FIREBASE_TOKEN="$FIREBASE_PUBLIC_TOKEN"
|
||||||
|
deploy 5 docs-flutter-io
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user