Skip to content

Commit 2065153

Browse files
committed
Get documentation version before building.
1 parent a5ed739 commit 2065153

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

scripts/update_json_docs.sh

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,22 @@ function cleanSubmodule () {
4545
}
4646

4747
# Run this to verifiy that the docs build successfully.
48-
buildDocs $TRAVIS_BRANCH
48+
if [[ ! -z ${TRAVIS_TAG} ]]; then
49+
DOC_VERSION = ${TRAVIS_TAG}
50+
else
51+
DOC_VERSION = ${TRAVIS_BRANCH}
52+
fi
53+
54+
buildDocs ${DOC_VERSION}
4955

5056
if [ "${TRAVIS_BRANCH}" == "master" ] && [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then
51-
buildDocs $TRAVIS_BRANCH
52-
pushDocs $TRAVIS_BRANCH
57+
pushDocs ${DOC_VERSION}
5358
cleanSubmodule
5459
echo "Done pushing docsite. See: https://googlecloudplatform.github.io/gcloud-python/"
5560
fi
5661

57-
if [[ ! -z $TRAVIS_TAG ]]; then
58-
buildDocs $TRAVIS_TAG
59-
pushDocs $TRAVIS_TAG
62+
if [[ ! -z ${TRAVIS_TAG} ]]; then
63+
pushDocs ${DOC_VERSION}
6064
cleanSubmodule
6165
echo "Done pushing docsite. See: https://googlecloudplatform.github.io/gcloud-python/"
6266
fi

0 commit comments

Comments
 (0)