Skip to content

Commit

Permalink
Add staging repos to GOPATH in verify-godeps
Browse files Browse the repository at this point in the history
This commit adds the staging repos to the GOPATH in
hack/verify-godeps.sh.  This allows vendored librarys
to depend on staging repos and not break verify-godeps.

This also adds `hack/godep-restore.sh`, which acts like
`godep restore`, but sets the GOPATH appropriate as well.
  • Loading branch information
DirectXMan12 committed Mar 1, 2017
1 parent e9eddd9 commit 77069cd
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
28 changes: 28 additions & 0 deletions hack/godep-restore.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

# Copyright 2017 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 nounset
set -o pipefail

KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
source "${KUBE_ROOT}/hack/lib/init.sh"
export GOPATH=${GOPATH}:${KUBE_ROOT}/staging
GODEP="${GODEP:-godep}"

echo "Starting to download all kubernetes godeps. This takes a while"
"${GODEP}" restore "$@"
echo "Download finished"
2 changes: 1 addition & 1 deletion hack/jenkins/verify-dockerized.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ cd /go/src/k8s.io/kubernetes

# hack/verify-client-go.sh requires all dependencies exist in the GOPATH.
# the retry helps avoid flakes while keeping total time bounded.
godep restore || godep restore
./hack/godep-restore.sh || ./hack/godep-restore.sh

./hack/install-etcd.sh
make verify
1 change: 1 addition & 0 deletions hack/verify-godeps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ pushd "${_kubetmp}" 2>&1 > /dev/null
pin-godep 'v74'
"${GODEP}" version

export GOPATH="${GOPATH}:${_kubetmp}/staging"
# Fill out that nice clean place with the kube godeps
echo "Starting to download all kubernetes godeps. This takes a while"
"${GODEP}" restore
Expand Down

0 comments on commit 77069cd

Please sign in to comment.