Skip to content

Instantly share code, notes, and snippets.

@dlsniper
Created June 25, 2017 11:38
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 dlsniper/6b3b9a74fd23daf12befcf47b0f1770a to your computer and use it in GitHub Desktop.
Save dlsniper/6b3b9a74fd23daf12befcf47b0f1770a to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
echo "Creating GOPATH for issue 3960..."
echo "This will create a folder named gopath3960"
read -p "Are you sure? " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
[[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
fi
mkdir -p gopath3960/src
cd gopath3960
export GOPATH=`pwd`
echo "New GOPATH will be: ${GOPATH}, please make sure that the go tool got the correct value"
go env
cd src
echo "Please make sure that the GOPATH is correctly set before continuing"
read -p "Are you sure? " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
[[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
fi
echo "Starting to clone repositories..."
mkdir -p k8s.io/kubernetes
cd k8s.io/
git clone git@github.com:kubernetes/kubernetes.git
cd ../
mkdir -p honnef.co/go/tools
cd honnef.co/go/tools
git clone git@github.com:dominikh/go-tools.git .
cd ../../../
mkdir -p github.com/moby
cd github.com/moby
git clone git@github.com:moby/moby.git
cd ../
mkdir hashicorp
git clone git@github.com:hashicorp/terraform.git
git clone git@github.com:hashicorp/consul.git
git clone git@github.com:hashicorp/vault.git
git clone git@github.com:hashicorp/nomad.git
git clone git@github.com:hashicorp/packer.git
cd ../
mkdir getlantern
cd getlantern
git clone git@github.com:getlantern/lantern.git
cd ../
mkdir gogits
cd gogits
git clone git@github.com:gogits/gogs.git
cd ../
mkdir gohugoio
cd gohugoio
git clone git@github.com:gohugoio/hugo.git
cd ../
mkdir grafana
cd grafana
git clone git@github.com:grafana/grafana.git
cd ../
mkdir syncthing
cd syncthing
git clone git@github.com:syncthing/syncthing.git
cd ../
mkdir coreos
cd coreos
git clone git@github.com:coreos/etcd.git
git clone git@github.com:coreos/flannel.git
git clone git@github.com:coreos/clair.git
git clone git@github.com:coreos/matchbox.git
cd ../
mkdir mholt
cd mholt
git clone git@github.com:mholt/caddy.git
cd ../
mkdir astaxie
cd astaxie
git clone git@github.com:astaxie/beego.git
cd ../
mkdir influxdata
cd influxdata
git clone git@github.com:influxdata/influxdb.git
cd ../
mkdir github
cd github
git clone git@github.com:github/hub.git
cd ../
mkdir cockroachdb
cd cockroachdb
git clone git@github.com:cockroachdb/cockroach.git
cd ../
mkdir inconshreveable
cd inconshreveable
git clone git@github.com:inconshreveable/ngrok.git
cd ../
mkdir gin-gonic
cd gin-gonic
git clone git@github.com:gin-gonic/gin.git
cd ../
mkdir cayleygraph
cd cayleygraph
git clone git@github.com:cayleygraph/cayley.git
cd ../
mkdir prometheus
cd prometheus
git clone git@github.com:prometheus/prometheus.git
cd ../
mkdir drone
cd drone
git clone git@github.com:drone/drone.git
cd ../
mkdir nsqio
cd nsqio
git clone git@github.com:nsqio/nsq.git
cd ../
mkdir junegunn
cd junegunn
git clone git@github.com:junegunn/fzf.git
cd ../
mkdir pingcap
cd pingcap
git clone git@github.com:pingcap/tidb.git
cd ../
mkdir containous
cd containous
git clone git@github.com:containous/traefik.git
cd ../
mkdir revel
cd revel
git clone git@github.com:revel/revel.git
cd ../
mkdir joewalnes
cd joewalnes
git clone git@github.com:joewalnes/websocketd.git
cd ../
mkdir google
cd google
git clone git@github.com:google/grumpy.git
cd ../
mkdir labstack
cd labstack
git clone git@github.com:labstack/echo.git
cd ../
mkdir buger
cd buger
git clone git@github.com:buger/goreplay.git
cd ../
mkdir minio
cd minio
git clone git@github.com:minio/minio.git
cd ../
mkdir rkt
cd rkt
git clone git@github.com:rkt/rkt.git
cd ../
mkdir go-kit
cd go-kit
git clone git@github.com:go-kit/kit.git
cd ../
echo "Cloning repositories finished."
sleep 1
echo "Preparing to run go get ./... in ${GOPATH}/src/github.com/... and then go get ${GOPATH}/src/..."
echo "This will take a while, 1h+ depending on your connection."
sleep 3
echo "Loading missing k8s dependencies"
go get -v -u -t k8s.io/apimachinery/... k8s.io/apiserver/...
echo "Running go get ./... ${GOPATH}/src/github.com/..."
go get -v -u -t ./...
cd ../
echo "Running go get ./... ${GOPATH}/src/..."
go get -v -u -t ./...
echo "Done. You can now point your editor at ${GOPATH} for the new GOPATH value"
echo "To reproduce the issue, create a project at ${GOPATH}/src/k8s.io/kubernetes and open: pkg/auth/authorizer/abac/abac.go"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment