2015-04-07 16:31:28 +00:00
|
|
|
# -*- mode: ruby -*-
|
|
|
|
# vi: set ft=ruby :
|
|
|
|
|
|
|
|
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
|
|
|
|
VAGRANTFILE_API_VERSION = "2"
|
|
|
|
|
|
|
|
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
|
|
|
|
|
|
|
config.vm.box = "ubuntu/trusty64"
|
2016-01-20 18:57:35 +00:00
|
|
|
config.vm.synced_folder "..", "/home/vagrant/go/src/github.com/influxdata/telegraf",
|
2015-08-25 17:23:40 +00:00
|
|
|
type: "rsync",
|
|
|
|
rsync__args: ["--verbose", "--archive", "--delete", "-z", "--safe-links"],
|
|
|
|
rsync__exclude: ["./telegraf", ".vagrant/"]
|
2015-08-19 16:39:53 +00:00
|
|
|
|
|
|
|
config.vm.provision "shell", name: "sudo", inline: <<-SHELL
|
|
|
|
chown -R vagrant:vagrant /home/vagrant/go
|
|
|
|
apt-get install bison git tig --yes
|
|
|
|
echo -n > /etc/profile.d/gopath.sh
|
|
|
|
echo 'export GOPATH=/home/vagrant/go' >> /etc/profile.d/gopath.sh
|
|
|
|
SHELL
|
|
|
|
|
|
|
|
config.vm.provision "shell", privileged: false, name: "user", inline: <<-SHELL
|
|
|
|
bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)
|
|
|
|
source "$HOME/.gvm/scripts/gvm"
|
|
|
|
gvm install go1.4.2 --prefer-binary
|
|
|
|
gvm use go1.4.2 --default
|
|
|
|
echo "export PATH=$PATH:$GOPATH/bin" >> "$HOME/.bashrc"
|
2015-08-20 22:09:09 +00:00
|
|
|
echo 'export GOPATH=/home/vagrant/go' >> "$HOME/.bashrc"
|
2016-01-20 18:57:35 +00:00
|
|
|
cd "$HOME/go/src/github.com/influxdata/telegraf" &&\
|
2015-08-20 22:09:09 +00:00
|
|
|
rm -rf Godeps/_workspace/pkg &&\
|
|
|
|
GOPATH="$HOME/go" make
|
2015-08-19 16:39:53 +00:00
|
|
|
SHELL
|
2015-04-07 16:31:28 +00:00
|
|
|
|
|
|
|
config.vm.provider "virtualbox" do |vb|
|
|
|
|
vb.customize ["modifyvm", :id, "--memory", "1024"]
|
|
|
|
end
|
|
|
|
end
|