Install go binary and make sure it's in the path for vagrant
This commit is contained in:
parent
76c49f6ed0
commit
7f1f91d2a3
|
@ -2,30 +2,28 @@
|
||||||
# vi: set ft=ruby :
|
# vi: set ft=ruby :
|
||||||
|
|
||||||
$script = <<SCRIPT
|
$script = <<SCRIPT
|
||||||
SRCROOT="/opt/go"
|
TARBALL="https://storage.googleapis.com/golang/go1.5.3.linux-amd64.tar.gz"
|
||||||
|
|
||||||
# Install Go
|
# Install Go
|
||||||
sudo apt-get update
|
sudo wget --progress=bar:force --output-document - ${TARBALL} |\
|
||||||
sudo apt-get install -y build-essential mercurial
|
tar xfz - -C /opt
|
||||||
sudo hg clone -u release https://code.google.com/p/go ${SRCROOT}
|
|
||||||
cd ${SRCROOT}/src
|
|
||||||
sudo ./all.bash
|
|
||||||
|
|
||||||
# Setup the GOPATH
|
# Setup the GOPATH
|
||||||
sudo mkdir -p /opt/gopath
|
sudo mkdir -p /opt/gopath
|
||||||
cat <<EOF >/tmp/gopath.sh
|
cat <<EOF >/tmp/gopath.sh
|
||||||
|
export GOROOT="/opt/go"
|
||||||
export GOPATH="/opt/gopath"
|
export GOPATH="/opt/gopath"
|
||||||
export PATH="/opt/go/bin:\$GOPATH/bin:\$PATH"
|
export PATH="/opt/go/bin:/opt/gopath/bin:\$PATH"
|
||||||
EOF
|
EOF
|
||||||
sudo mv /tmp/gopath.sh /etc/profile.d/gopath.sh
|
sudo mv /tmp/gopath.sh /etc/profile.d/gopath.sh
|
||||||
sudo chmod 0755 /etc/profile.d/gopath.sh
|
|
||||||
|
|
||||||
# Make sure the gopath is usable by vagrant
|
# Make sure the gopath is usable by vagrant
|
||||||
sudo chown -R vagrant:vagrant $SRCROOT
|
sudo chown -R vagrant:vagrant /opt/go
|
||||||
sudo chown -R vagrant:vagrant /opt/gopath
|
sudo chown -R vagrant:vagrant /opt/gopath
|
||||||
|
|
||||||
# Install some other stuff we need
|
# Install some other stuff we need
|
||||||
sudo apt-get install -y curl git bzr zip
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y curl git mercurial bzr zip
|
||||||
SCRIPT
|
SCRIPT
|
||||||
|
|
||||||
Vagrant.configure(2) do |config|
|
Vagrant.configure(2) do |config|
|
||||||
|
|
Loading…
Reference in New Issue