Hack to make godep work again

pull/6/head
Eric Paris 2015-09-18 10:49:29 -05:00
parent 0f8cc8926f
commit ed5668f405
1 changed files with 23 additions and 0 deletions

View File

@ -18,6 +18,24 @@ set -o errexit
set -o nounset
set -o pipefail
#### HACK ####
# Sometimes godep just can't handle things. This lets use manually put
# some deps in place first, so godep won't fall over.
preload-dep() {
org="$1"
project="$2"
sha="$3"
org_dir="${GOPATH}/src/${org}"
mkdir -p "${org_dir}"
pushd "${org_dir}" > /dev/null
git clone "https://${org}/${project}.git" > /dev/null 2>&1
pushd "${org_dir}/${project}" > /dev/null
git checkout "${sha}" > /dev/null 2>&1
popd > /dev/null
popd > /dev/null
}
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
source "${KUBE_ROOT}/hack/lib/init.sh"
@ -43,6 +61,11 @@ GODEP="${_tmpdir}/bin/godep"
# fill out that nice clean place with the kube godeps
echo "Starting to download all kubernetes godeps. This takes a while"
# github.com/prometheus/client_golang removed the model and extraction directory.
# thus go get fails and thus godep fails. So load it by hand.
preload-dep "github.com/prometheus" "client_golang" "692492e54b553a81013254cc1fba4b6dd76fad30"
"${GODEP}" restore
echo "Download finished"