github.com/graybobo/golang.org-package-offline-cache@v0.0.0-20200626051047-6608995c132f/x/tools/dashboard/env/linux-x86-nacl/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 /usr/local/bin && curl -s -O https://storage.googleapis.com/gobuilder/sel_ldr_x86_32 && chmod +x sel_ldr_x86_32)
    23  (cd /usr/local/bin && curl -s -O https://storage.googleapis.com/gobuilder/sel_ldr_x86_64 && chmod +x sel_ldr_x86_64)
    24  
    25  ln -s $GOROOT/misc/nacl/go_nacl_386_exec /usr/local/bin/
    26  ln -s $GOROOT/misc/nacl/go_nacl_amd64p32_exec /usr/local/bin/
    27  
    28  cd $GOROOT
    29  git clean -f -d -x
    30  git checkout master