github.com/dahs81/otto@v0.2.1-0.20160126165905-6400716cf085/images/scripts/common/go.sh (about)

     1  #!/bin/sh -eux
     2  
     3  GO_VERSION="1.5.1"
     4  
     5  # Download and install Go
     6  wget -q -O /tmp/go.tar.gz https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz
     7  tar -C /usr/local -xzf /tmp/go.tar.gz
     8  rm /tmp/go.tar.gz
     9  
    10  # Setup GOPATH
    11  mkdir -p /opt/gopath
    12  
    13  # Setup the PATH data in the bashrc for vagrant
    14  echo 'export PATH=/opt/gopath/bin:/usr/local/go/bin:$PATH' >> /home/vagrant/.bashrc
    15  echo 'export GOPATH=/opt/gopath' >> /home/vagrant/.bashrc
    16  
    17  # Install various VCS for specific platforms
    18  if command -v apt-get >/dev/null 2>&1; then
    19      apt-get install -y git bzr mercurial
    20  fi