Merge pull request #27808 from david-mcmahon/kube-upstream

Automatic merge from submit-queue

Move KUBE_GIT_UPSTREAM out of init.sh and into *-munge-docs.sh.

It is only used in those 2 scripts and this way we can set the value dynamically.
Clean up a bit too (80col, formatting)
This commit is contained in:
k8s-merge-robot
2016-07-08 13:32:09 -07:00
committed by GitHub
3 changed files with 16 additions and 7 deletions

View File

@@ -21,6 +21,9 @@ set -o pipefail
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
source "${KUBE_ROOT}/hack/lib/init.sh"
git_upstream=$(kube::util::git_upstream_remote_name)
: ${git_upstream:="upstream"}
kube::golang::setup_env
"${KUBE_ROOT}/hack/build-go.sh" \
@@ -35,7 +38,7 @@ EXAMPLEROOT="${KUBE_ROOT}/examples/"
# mungedocs --verify can (and should) be run on the real docs, otherwise their
# links will be distorted. --verify means that it will not make changes.
# --verbose gives us output we can use for a diff.
"${mungedocs}" "--verify=true" "--verbose=true" "--upstream=${KUBE_GIT_UPSTREAM}" "--root-dir=${DOCROOT}" && ret=0 || ret=$?
"${mungedocs}" "--verify=true" "--verbose=true" "--upstream=${git_upstream}" "--root-dir=${DOCROOT}" && ret=0 || ret=$?
if [[ $ret -eq 1 ]]; then
echo "${DOCROOT} is out of date. Please run hack/update-munge-docs.sh"
exit 1
@@ -45,7 +48,7 @@ if [[ $ret -gt 1 ]]; then
exit 1
fi
"${mungedocs}" "--verify=true" "--verbose=true" "--upstream=${KUBE_GIT_UPSTREAM}" "--root-dir=${EXAMPLEROOT}" && ret=0 || ret=$?
"${mungedocs}" "--verify=true" "--verbose=true" "--upstream=${git_upstream}" "--root-dir=${EXAMPLEROOT}" && ret=0 || ret=$?
if [[ $ret -eq 1 ]]; then
echo "${EXAMPLEROOT} is out of date. Please run hack/update-munge-docs.sh"
exit 1