Skip to content

Instantly share code, notes, and snippets.

@nikhita
Last active October 5, 2018 10:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nikhita/183c20c8dd1a34b4ba04ef38b244d67b to your computer and use it in GitHub Desktop.
Save nikhita/183c20c8dd1a34b4ba04ef38b244d67b to your computer and use it in GitHub Desktop.
Glide test for client-go release v9.0.0
#!/bin/bash -ex
rm -rf cache.new
if [ ! -d cache ]; then
mkdir cache.new
pushd cache.new
for repo in $(ls -1 ../kubernetes/staging/src/k8s.io); do
git clone https://github.com/kubernetes/${repo}.git
done
popd
mv cache.new cache
fi
for repo in $(ls -1 kubernetes/staging/src/k8s.io); do
rm -rf ${repo}
git clone --reference ./cache/${repo} https://github.com/kubernetes/${repo}.git
done
# do this if the tag has still not been published
# it's very hacky
# cd client-go && git remote rename origin upstream && git remote add origin https://github.com/nikhita/client-go.git && git fetch origin --tags && cd ..
function kubeDeps() {
jq -r ".Deps | map(.ImportPath) | .[]" Godeps/Godeps.json | grep "^k8s.io/" | cut -d/ -f2 | sort -u
}
function rmVendorsInKubeDeps() {
for dep in $(kubeDeps); do
pushd ../${dep} >/dev/null
git rm -q -rf vendor/ && git commit -m "rm vendor/" -q || true
popd
done
}
for branch in v9.0.0; do
pushd client-go
git checkout ${branch}
godep restore
go build ./...
git reset --hard
git clean -f -f -d
popd
done
for branch in v9.0.0; do
pushd $GOPATH/src/github.com/nikhita/kube-glide-test
git checkout ${branch}
glide cache-clear
rm -rf glide.lock vendor/
glide install --strip-vendor
go build .
git reset --hard
git clean -f -f -d
popd
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment