github.com/graybobo/golang.org-package-offline-cache@v0.0.0-20200626051047-6608995c132f/x/tools/dashboard/env/linux-x86-base/scripts/build-go-builder.sh (about)

     1  set -ex
     2  
     3  export GOPATH=/gopath
     4  export GOROOT=/goroot
     5  PREFIX=/usr/local
     6  : ${GO_REV:?"need to be set to the golang repo revision used to build the builder."}
     7  : ${BUILDER_REV:?"need to be set to the go.tools repo revision for the builder."}
     8  
     9  mkdir -p $GOROOT
    10  git clone https://go.googlesource.com/go $GOROOT
    11  (cd $GOROOT/src && git checkout $GO_REV && find && ./make.bash)
    12  
    13  GO_TOOLS=$GOPATH/src/golang.org/x/tools
    14  mkdir -p $GO_TOOLS
    15  git clone https://go.googlesource.com/tools $GO_TOOLS
    16  
    17  mkdir -p $PREFIX/bin
    18  (cd $GO_TOOLS && git reset --hard $BUILDER_REV && GOBIN=$PREFIX/bin /goroot/bin/go install golang.org/x/tools/dashboard/builder)
    19  
    20  rm -fR $GOROOT/bin $GOROOT/pkg $GOPATH
    21  
    22  cd $GOROOT
    23  git clean -f -d -x
    24  git checkout master