kubernetes/hack/update-bindata.sh
Jeff Mendoza 95b73058d2 Removed non-md files from docs. Moved doc yamls to test/fixtures.
Most of the contents of docs/ has moved to kubernetes.github.io.
Development of the docs and accompanying files has continued there, making
the copies in this repo stale. I've removed everything but the .md files
which remain to redirect old links. The .yaml config files in the docs
were used by some tests, these have been moved to test/fixtures/doc-yaml,
and can remain there to be used by tests or other purposes.
2016-08-25 15:09:27 -07:00

51 lines
1.6 KiB
Bash
Executable File

#!/bin/bash
# Copyright 2016 The Kubernetes Authors.
#
# 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 -o errexit
set -o pipefail
set -o nounset
if [[ -z "${KUBE_ROOT:-}" ]]; then
# Relative to test/e2e/generated/
KUBE_ROOT="../../../"
fi
source "${KUBE_ROOT}/cluster/lib/logging.sh"
if [[ ! -d "${KUBE_ROOT}/examples" ]]; then
echo "${KUBE_ROOT}/examples not detected. This script should be run from a location where the source dirs are available."
exit 1
fi
if ! which go-bindata &>/dev/null ; then
echo "Cannot find go-bindata. Install with"
echo " go get -u github.com/jteeuwen/go-bindata/go-bindata"
exit 5
fi
BINDATA_OUTPUT="${KUBE_ROOT}/test/e2e/generated/bindata.go"
go-bindata -nometadata -prefix "${KUBE_ROOT}" -o ${BINDATA_OUTPUT} -pkg generated \
-ignore .jpg -ignore .png -ignore .md \
"${KUBE_ROOT}/examples/..." \
"${KUBE_ROOT}/docs/user-guide/..." \
"${KUBE_ROOT}/test/e2e/testing-manifests/..." \
"${KUBE_ROOT}/test/images/..." \
"${KUBE_ROOT}/test/fixtures/..."
gofmt -s -w ${BINDATA_OUTPUT}
V=2 kube::log::info "Generated bindata file : $(wc -l ${BINDATA_OUTPUT}) lines of lovely automated artifacts"