123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- #!/usr/bin/env bash
- set -o errexit
- set -o pipefail
- set -o nounset
- KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
- export KUBE_ROOT
- source "${KUBE_ROOT}/hack/lib/init.sh"
- source "${KUBE_ROOT}/hack/lib/logging.sh"
- if [[ ! -d "${KUBE_ROOT}/pkg" ]]; then
- echo "${KUBE_ROOT}/pkg not detected. This script should be run from a location where the source dirs are available."
- exit 1
- fi
- export PATH="${KUBE_OUTPUT_BINPATH}:${PATH}"
- if ! which go-bindata &>/dev/null ; then
- echo "Cannot find go-bindata."
- exit 5
- fi
- pushd "${KUBE_ROOT}" >/dev/null
- BINDATA_OUTPUT="test/e2e/generated/bindata.go"
- go-bindata -nometadata -o "${BINDATA_OUTPUT}.tmp" -pkg generated \
- -ignore .jpg -ignore .png -ignore .md -ignore 'BUILD(\.bazel)?' \
- "test/e2e/testing-manifests/..." \
- "test/images/..." \
- "test/fixtures/..."
- gofmt -s -w "${BINDATA_OUTPUT}.tmp"
- if ! cmp -s "${BINDATA_OUTPUT}.tmp" "${BINDATA_OUTPUT}" ; then
- cat "${BINDATA_OUTPUT}.tmp" > "${BINDATA_OUTPUT}"
- V=2 kube::log::info "Generated bindata file : ${BINDATA_OUTPUT} has $(wc -l ${BINDATA_OUTPUT}) lines of lovely automated artifacts"
- else
- V=2 kube::log::info "No changes in generated bindata file: ${BINDATA_OUTPUT}"
- fi
- rm -f "${BINDATA_OUTPUT}.tmp"
- BINDATA_OUTPUT="pkg/kubectl/generated/bindata.go"
- go-bindata -nometadata -nocompress -o "${BINDATA_OUTPUT}.tmp" -pkg generated \
- -ignore .jpg -ignore .png -ignore .md -ignore 'BUILD(\.bazel)?' \
- "translations/..."
- gofmt -s -w "${BINDATA_OUTPUT}.tmp"
- if ! cmp -s "${BINDATA_OUTPUT}.tmp" "${BINDATA_OUTPUT}" ; then
- cat "${BINDATA_OUTPUT}.tmp" > "${BINDATA_OUTPUT}"
- V=2 kube::log::info "Generated bindata file : ${BINDATA_OUTPUT} has $(wc -l ${BINDATA_OUTPUT}) lines of lovely automated artifacts"
- else
- V=2 kube::log::info "No changes in generated bindata file: ${BINDATA_OUTPUT}"
- fi
- rm -f "${BINDATA_OUTPUT}.tmp"
- popd >/dev/null
|