mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 14:07:14 +00:00
pin godep version
This commit is contained in:
parent
0625db73db
commit
7153c91617
@ -29,14 +29,34 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
|
|||||||
|
|
||||||
kube::golang::setup_env
|
kube::golang::setup_env
|
||||||
|
|
||||||
|
ORIGINAL_GOPATH="${GOPATH}"
|
||||||
|
|
||||||
|
godepBinDir=${TMPDIR:-/tmp/}/kube-godep-bin
|
||||||
|
mkdir -p "${godepBinDir}"
|
||||||
|
godep=${godepBinDir}/bin/godep
|
||||||
|
pushd "${godepBinDir}" 2>&1 > /dev/null
|
||||||
|
# Build the godep tool
|
||||||
|
GOPATH="${godepBinDir}"
|
||||||
|
rm -rf *
|
||||||
|
go get -u github.com/tools/godep 2>/dev/null
|
||||||
|
export GODEP="${GOPATH}/bin/godep"
|
||||||
|
pin-godep() {
|
||||||
|
pushd "${GOPATH}/src/github.com/tools/godep" > /dev/null
|
||||||
|
git checkout "$1"
|
||||||
|
"${GODEP}" go install
|
||||||
|
popd > /dev/null
|
||||||
|
}
|
||||||
|
# Use to following if we ever need to pin godep to a specific version again
|
||||||
|
pin-godep 'v74'
|
||||||
|
"${godep}" version
|
||||||
|
popd 2>&1 > /dev/null
|
||||||
|
|
||||||
# keep the godep restore path reasonably stable to avoid unnecessary restores
|
# keep the godep restore path reasonably stable to avoid unnecessary restores
|
||||||
godepRestoreDir=${TMPDIR:-/tmp/}/kube-godep-restore
|
godepRestoreDir=${TMPDIR:-/tmp/}/kube-godep-restore
|
||||||
|
|
||||||
TARGET_DIR=${TARGET_DIR:-${KUBE_ROOT}/staging}
|
TARGET_DIR=${TARGET_DIR:-${KUBE_ROOT}/staging}
|
||||||
echo "working in ${TARGET_DIR}"
|
echo "working in ${TARGET_DIR}"
|
||||||
|
|
||||||
ORIGINAL_GOPATH="${GOPATH}"
|
|
||||||
|
|
||||||
SKIP_RESTORE=${SKIP_RESTORE:-}
|
SKIP_RESTORE=${SKIP_RESTORE:-}
|
||||||
if [ "${SKIP_RESTORE}" != "true" ]; then
|
if [ "${SKIP_RESTORE}" != "true" ]; then
|
||||||
echo "starting godep restore"
|
echo "starting godep restore"
|
||||||
@ -46,7 +66,7 @@ if [ "${SKIP_RESTORE}" != "true" ]; then
|
|||||||
GOPATH="${godepRestoreDir}:${KUBE_ROOT}/staging:${ORIGINAL_GOPATH}"
|
GOPATH="${godepRestoreDir}:${KUBE_ROOT}/staging:${ORIGINAL_GOPATH}"
|
||||||
# restore from kubernetes godeps to ensure we get the correct levels
|
# restore from kubernetes godeps to ensure we get the correct levels
|
||||||
# you get errors about the staging repos not using a known version control system
|
# you get errors about the staging repos not using a known version control system
|
||||||
godep restore > ${godepRestoreDir}/godep-restore.log
|
${godep} restore > ${godepRestoreDir}/godep-restore.log
|
||||||
echo "finished godep restore"
|
echo "finished godep restore"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -79,7 +99,7 @@ function updateGodepManifest() {
|
|||||||
rm -rf ${TARGET_DIR}/src/${repo}/Godeps
|
rm -rf ${TARGET_DIR}/src/${repo}/Godeps
|
||||||
GOPATH="${godepRestoreDir}:${TARGET_DIR}"
|
GOPATH="${godepRestoreDir}:${TARGET_DIR}"
|
||||||
pushd ${TARGET_DIR}/src/${repo}
|
pushd ${TARGET_DIR}/src/${repo}
|
||||||
godep save ./...
|
${godep} save ./...
|
||||||
|
|
||||||
# now remove all the go files. We'll re-run a restore, go get, godep save cycle in the sync scripts
|
# now remove all the go files. We'll re-run a restore, go get, godep save cycle in the sync scripts
|
||||||
# to get the commits for other staging k8s.io repos anyway, so we don't need the added files
|
# to get the commits for other staging k8s.io repos anyway, so we don't need the added files
|
||||||
|
Loading…
Reference in New Issue
Block a user