1#!/bin/bash 2# 3# How to use: 4# From directory {root}/docs/source.android.com/scripts run: 5# $ ./build2stage.sh <server number> 6# 7# For example, to build and stage on staging instance 13, run: 8# $ ./build2stage.sh 13 9# 10 11echo 'Please run this script from the docs/source.android.com/scripts directory ' \ 12 ' branch/docs/source.android.com/scripts' 13echo ' ' 14 15# Read the configuration file to retrieve the App Engine staging - AE_STAGING - value 16source /etc/profile.d/build2stage-conf.sh 17 18# Go up three directories to build content 19cd ../../.. 20 21# Delete old output 22rm -rf out/target/common/docs/online-sac* 23 24# Initialize the environment 25source build/envsetup.sh 26 27# Make the docs 28make online-sac-docs 29 30# Go to the output directory to stage content 31cd out/target/common/docs 32 33# Edit the app.yaml file to upload to the specified server. 34sed 's/staging[0-9]*$/staging'$1'/' online-sac/app.yaml > .temp 35 36# Copy in new app.yaml content 37cp .temp online-sac/app.yaml 38rm .temp 39 40# Stage the data on the server. 41$AE_STAGING update online-sac 42 43echo 'Your staged content is available at staging instance '$1'' 44