diff --git a/.travis.yml b/.travis.yml index 1d560ffb2848..675a063c64ea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ script: - tox -e lint - tox -e system-tests - tox -e system-tests3 - - scripts/merge.sh + - scripts/update_docs.sh after_success: - tox -e coveralls diff --git a/scripts/merge.sh b/scripts/merge.sh deleted file mode 100755 index bb7ec8a7918a..000000000000 --- a/scripts/merge.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - -# Copyright 2014 Google Inc. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -ev - -############################################## -# Perform actions if we are updating master. # -############################################## -if [[ "${TRAVIS_BRANCH}" == "master" ]] && \ - [[ "${TRAVIS_PULL_REQUEST}" == "false" ]]; then - echo "Building new docs on a merged commit." - scripts/update_docs.sh -elif [[ -n "${TRAVIS_TAG}" ]]; then - echo "Building new docs on a tag." - scripts/update_docs.sh -else - echo "Not in master on a non-pull request. Doing nothing." -fi diff --git a/scripts/update_docs.sh b/scripts/update_docs.sh index afb92c70cfdb..68ab1a6896b8 100755 --- a/scripts/update_docs.sh +++ b/scripts/update_docs.sh @@ -16,6 +16,19 @@ set -ev +######################################### +# Only update docs if we are on Travis. # +######################################### +if [[ "${TRAVIS_BRANCH}" == "master" ]] && \ + [[ "${TRAVIS_PULL_REQUEST}" == "false" ]]; then + echo "Building new docs on a merged commit." +elif [[ -n "${TRAVIS_TAG}" ]]; then + echo "Building new docs on a tag." +else + echo "Not on Travis, doing nothing." + exit +fi + # Adding GitHub pages branch. `git submodule add` checks it # out at HEAD. GH_PAGES_DIR="ghpages"