-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile
49 lines (35 loc) · 1.26 KB
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# -*- mode: ruby -*-
# vi: set ft=ruby :
GO_ARCHIVE = "go1.6.linux-amd64.tar.gz"
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.provision "shell", privileged: false, inline: <<-SHELL
sudo apt-get update
sudo apt-get install -y mercurial git
echo "Downloading #{GO_ARCHIVE}..."
wget --quiet https://storage.googleapis.com/golang/#{GO_ARCHIVE}
echo "Done!"
echo "Unpacking #{GO_ARCHIVE}"
sudo tar -C /usr/local -xzf #{GO_ARCHIVE}
echo "Done!"
echo "Setting up environment..."
mkdir /home/vagrant/go
mkdir /home/vagrant/go/src
mkdir /home/vagrant/go/pkg
mkdir /home/vagrant/go/bin
mkdir -p /home/vagrant/go/src/github.com/applikatoni
ln -s /vagrant /home/vagrant/go/src/github.com/applikatoni/toni
echo "Directory structure created."
echo 'export GOPATH=/home/vagrant/go' >> /home/vagrant/.profile
echo 'export PATH=$PATH:$GOPATH/bin:/usr/local/go/bin' >> /home/vagrant/.profile
source /home/vagrant/.profile
echo "Environment variables set up."
echo "Installing toni main repo..."
cd /home/vagrant/go/src/github.com/applikatoni/toni
go get ./...
go install ./...
echo "Installed."
echo "Running tests..."
go test -v ./...
SHELL
end