hack/*protobuf.sh: dynamically find api roots

This commit is contained in:
Dr. Stefan Schimanski
2019-03-04 21:49:41 +01:00
parent fd62585bd0
commit 45b0d9bd0a
3 changed files with 12 additions and 54 deletions

View File

@@ -24,6 +24,12 @@ KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
# source tree. This is managed in kube::build::copy_output in build/common.sh.
# If the output set is changed update that function.
"${KUBE_ROOT}/build/run.sh" hack/update-generated-protobuf-dockerized.sh "$@"
APIROOTS=${APIROOTS:-$(git grep --files-with-matches -e '// +k8s:protobuf-gen=package' cmd pkg staging | \
xargs -n 1 dirname | \
sed 's,^,k8s.io/kubernetes/,;s,k8s.io/kubernetes/staging/src/,,' | \
sort | uniq
)}
"${KUBE_ROOT}/build/run.sh" hack/update-generated-protobuf-dockerized.sh "${APIROOTS}" "$@"
# ex: ts=2 sw=2 et filetype=sh