github.com/boson-project/source-to-image@v1.2.0/hack/godep-save.sh (about) 1 #!/bin/bash 2 3 pin-godep() { 4 pushd "${GOPATH}/src/github.com/tools/godep" > /dev/null 5 git checkout "$1" 6 "${GODEP}" go install 7 popd > /dev/null 8 } 9 10 # Some things we want in godeps are windows code dependencies, so ./... 11 # won't pick them up. 12 REQUIRED_BINS=( 13 "golang.org/x/crypto/ssh/terminal" 14 "./..." 15 ) 16 17 # build the godep tool 18 # Again go get stinks, hence || true 19 go get -u github.com/tools/godep 2>/dev/null || true 20 GODEP="${GOPATH}/bin/godep" 21 22 # Use to following if we ever need to pin godep to a specific version again 23 pin-godep 'v79' 24 25 godep-save () { 26 echo "Deleting vendor/ and Godeps/" 27 rm -rf vendor/ Godeps/ 28 echo "Running godep-save. This takes around 5 minutes." 29 "${GODEP}" save "$@" 30 } 31 32 missing-test-deps () { 33 go list -f $'{{range .Imports}}{{.}}\n{{end}}{{range .TestImports}}{{.}}\n{{end}}{{range .XTestImports}}{{.}}\n{{end}}' ./vendor/k8s.io/kubernetes/... | grep '\.' | grep -v github.com/openshift/origin | sort -u || true 34 } 35 36 godep-save -t "${REQUIRED_BINS[@]}"