mirror of https://github.com/k3s-io/k3s
Merge pull request #43779 from ixdy/hack-bazel-scripts
Automatic merge from submit-queue (batch tested with PRs 38741, 41301, 43645, 43779, 42337) If we already have the right version of gazel installed, use it **What this PR does / why we need it**: makes the bazel scripts marginally faster by only downloading/building gazel when necessary. Also removes the `followRedirects` config setting for gopkg.in which is no longer needed. **Release note**: ```release-note NONE ```pull/6/head
commit
fad2753a2c
|
@ -20,9 +20,7 @@ set -o pipefail
|
||||||
export KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
|
export KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
|
||||||
source "${KUBE_ROOT}/hack/lib/init.sh"
|
source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||||
|
|
||||||
git config http.https://gopkg.in.followRedirects true
|
go get gopkg.in/mikedanese/gazel.v14/gazel
|
||||||
|
|
||||||
go get -u gopkg.in/mikedanese/gazel.v14/gazel
|
|
||||||
|
|
||||||
for path in ${GOPATH//:/ }; do
|
for path in ${GOPATH//:/ }; do
|
||||||
if [[ -e "${path}/bin/gazel" ]]; then
|
if [[ -e "${path}/bin/gazel" ]]; then
|
||||||
|
@ -34,4 +32,5 @@ if [[ -z "${gazel:-}" ]]; then
|
||||||
echo "Couldn't find gazel on the GOPATH."
|
echo "Couldn't find gazel on the GOPATH."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
"${gazel}" -root="$(kube::realpath ${KUBE_ROOT})"
|
"${gazel}" -root="$(kube::realpath ${KUBE_ROOT})"
|
||||||
|
|
|
@ -20,10 +20,20 @@ set -o pipefail
|
||||||
export KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
|
export KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
|
||||||
source "${KUBE_ROOT}/hack/lib/init.sh"
|
source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||||
|
|
||||||
git config http.https://gopkg.in.followRedirects true
|
go get gopkg.in/mikedanese/gazel.v14/gazel
|
||||||
|
|
||||||
go get -u gopkg.in/mikedanese/gazel.v14/gazel
|
for path in ${GOPATH//:/ }; do
|
||||||
if ! "${GOPATH}/bin/gazel" -validate -print-diff -root="$(kube::realpath ${KUBE_ROOT})" ; then
|
if [[ -e "${path}/bin/gazel" ]]; then
|
||||||
|
gazel="${path}/bin/gazel"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if [[ -z "${gazel:-}" ]]; then
|
||||||
|
echo "Couldn't find gazel on the GOPATH."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! "${gazel}" -validate -print-diff -root="$(kube::realpath ${KUBE_ROOT})" ; then
|
||||||
echo
|
echo
|
||||||
echo "Run ./hack/update-bazel.sh"
|
echo "Run ./hack/update-bazel.sh"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
Loading…
Reference in New Issue