Skip to content

Commit 996c13b

Browse files
committed
Add buildDocs function for build verification.
1 parent 339240b commit 996c13b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

scripts/update_json_docs.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@
22

33
set -e
44

5-
function pushDocs () {
65

6+
function buildDocs () {
77
echo "Building JSON documentation..."
88
PYTHONPATH=_testing python scripts/generate_json_docs.py --tag ${1}
99
echo "Done building JSON documentation."
10+
}
11+
1012

13+
function pushDocs () {
1114
echo "Deploying JSON documentation..."
1215
if [[ ! -d "ghpages" ]]; then
1316
git submodule add -f -b gh-pages https://${GH_OAUTH_TOKEN}@github.com/${GH_OWNER}/${GH_PROJECT_NAME} ghpages
@@ -41,13 +44,18 @@ function cleanSubmodule () {
4144
echo "Done cleaning up!"
4245
}
4346

47+
# Run this to verifiy that the docs build successfully.
48+
buildDocs $TRAVIS_BRANCH
49+
4450
if [ "${TRAVIS_BRANCH}" == "master" ] && [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then
51+
buildDocs $TRAVIS_BRANCH
4552
pushDocs $TRAVIS_BRANCH
4653
cleanSubmodule
4754
echo "Done pushing docsite. See: https://googlecloudplatform.github.io/gcloud-python/"
4855
fi
4956

5057
if [[ ! -z $TRAVIS_TAG ]]; then
58+
buildDocs $TRAVIS_TAG
5159
pushDocs $TRAVIS_TAG
5260
cleanSubmodule
5361
echo "Done pushing docsite. See: https://googlecloudplatform.github.io/gcloud-python/"

0 commit comments

Comments
 (0)