| 12345678910111213141516171819202122232425 |
- #!/bin/sh
- #
- # Prepare a new instance to run a Go gRPC sample app.
- #
- sudo apt-get update
- sudo apt-get install -y unzip # we use unzip to unpack the protoc build
- sudo apt-get install -y psmisc # this provides killall, which is used by the SETUP script
- # Create a directory to contain tools that we need.
- mkdir $HOME/tools
- # Download Go and install it in tools/go.
- wget https://storage.googleapis.com/golang/go1.6.linux-amd64.tar.gz
- tar -C $HOME/tools -xzf go1.6.linux-amd64.tar.gz
- # Download protoc and install it in tools/protobuf.
- wget https://github.com/google/protobuf/releases/download/v3.0.0-beta-2/protoc-3.0.0-beta-2-linux-x86_64.zip
- unzip protoc-3.0.0-beta-2-linux-x86_64.zip -d $HOME/tools/protobuf
- # Set the PATH and GOROOT.
- cat <<EOF >$HOME/.bash_profile
- export PATH=\$HOME/tools/go/bin:\$HOME/tools/protobuf:\$PATH
- export GOROOT=\$HOME/tools/go
- EOF
|