godep-save.sh 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/bin/bash
  2. # Copyright 2016 The Kubernetes Authors.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. set -o errexit
  16. set -o nounset
  17. set -o pipefail
  18. KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
  19. source "${KUBE_ROOT}/hack/lib/init.sh"
  20. export GOPATH=${GOPATH}:${KUBE_ROOT}/staging
  21. GODEP="${GODEP:-godep}"
  22. # Some things we want in godeps aren't code dependencies, so ./...
  23. # won't pick them up.
  24. REQUIRED_BINS=(
  25. "github.com/ugorji/go/codec/codecgen"
  26. "github.com/onsi/ginkgo/ginkgo"
  27. "./..."
  28. )
  29. pushd "${KUBE_ROOT}" > /dev/null
  30. GO15VENDOREXPERIMENT=1 ${GODEP} save "${REQUIRED_BINS[@]}"
  31. # create a symlink in vendor directory pointing to the staging client. This
  32. # let other packages use the staging client as if it were vendored.
  33. if [ ! -e "vendor/k8s.io/client-go" ]; then
  34. ln -s ../../staging/src/k8s.io/client-go vendor/k8s.io/client-go
  35. fi
  36. popd > /dev/null