diff --git a/scripts/eris_dev/README.md b/scripts/eris_dev/README.md index 6ede825..dbe6f2c 100644 --- a/scripts/eris_dev/README.md +++ b/scripts/eris_dev/README.md @@ -26,11 +26,16 @@ We do this first because its easier as root `source ./install_docker.sh` +## Install golang +Check that version is up to date + +`source ./install_go.sh` + ## Harden the server `bash new_server.sh` -Note you should only ever run this script once. +Note: you should only ever run this script once. You should now be some user (not root). As this new user, run: @@ -42,12 +47,6 @@ Log out and ssh back in with the new user and go back to the directory `cd coding/scripts/eris_dev` -## Install golang -Check that version is up to date - -`source ./install_go.sh` - - Log in and back out of the server for the changes to take hold. ## Install vim-go diff --git a/scripts/eris_dev/install_go.sh b/scripts/eris_dev/install_go.sh index 02d3fa7..d8ec5d1 100644 --- a/scripts/eris_dev/install_go.sh +++ b/scripts/eris_dev/install_go.sh @@ -1,29 +1,15 @@ #!/bin/bash -x # set -e -# assumes dependencies have already been installed (eg. make screen gcc git mercurial libc6-dev pkg-config libgmp-dev) - -if [ `whoami` == "root" ]; -then - echo "You should not run this script as root" - exit 1 -fi - -USER=`whoami` - -# install go -cd /home/$USER -cd /home/$USER - -wget https://storage.googleapis.com/golang/go1.5.3.src.tar.gz -tar -xzvf go*.tar.gz -cd go/src -./make.bash -cd /home/$USER - -echo "export GOROOT=/home/$USER/go" >> /home/$USER/.profile -echo "export GOPATH=/home/$USER/goApps" >> /home/$USER/.profile -echo 'export PATH=$PATH:$GOROOT/bin' >> /home/$USER/.profile -source /home/$USER/.profile - -cd /home/$USER/coding/scripts/eris_dev +GOVERSION="1.5" + +curl -sSL https://storage.googleapis.com/golang/go"$GOVERSION".linux-amd64.tar.gz | sudo tar -C /usr/local -xzf - &>/dev/null + +## TODO fix for the new user +mkdir --parents $HOME/go +export GOPATH=$HOME/go +export PATH=$HOME/go/bin:/usr/local/go/bin:$PATH +echo "export GOROOT=/usr/local/go" >> $HOME/.bashrc +echo "export GOPATH=$HOME/go" >> $HOME/.bashrc +echo "export PATH=$HOME/go/bin:/usr/local/go/bin:$PATH" >> $HOME/.bashrc +echo "Finished Setting up Go."