Skip to content

Commit c366703

Browse files
author
Braxton Huggins
committed
add Vagrantfile to allow testing within a virtual machine.
1 parent cac1a63 commit c366703

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ _cgo_gotypes.go
1818
_cgo_export.*
1919

2020
_testmain.go
21+
.vagrant
2122

2223
*.exe
2324
*.test

Vagrantfile

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# -*- mode: ruby -*-
2+
# vi: set ft=ruby :
3+
4+
# determine vagrant provider
5+
ENV['VAGRANT_DEFAULT_PROVIDER'] = ENV['NANOBOX_BUILD_VAGRANT_PROVIDER'] || 'virtualbox'
6+
7+
Vagrant.configure('2') do |config|
8+
9+
config.vm.box = 'ubuntu/trusty64'
10+
11+
config.vm.provider 'virtualbox' do |v|
12+
v.memory = 1024
13+
v.cpus = 1
14+
end
15+
16+
config.vm.provider "vmware_fusion" do |v, override|
17+
v.vmx["memsize"] = "1024"
18+
v.vmx["numvcpus"] = "1"
19+
v.gui = false
20+
override.vm.box = "trusty64_vmware"
21+
override.vm.box_url = 'https://github.com/pagodabox/vagrant-packer-templates/releases/download/v0.2.0/trusty64_vmware.box'
22+
end
23+
24+
config.vm.network "private_network", type: "dhcp"
25+
26+
config.vm.provision "shell", inline: <<-SCRIPT
27+
echo "installing build tools..."
28+
apt-get -y update -qq
29+
apt-get -y upgrade
30+
apt-get install -y build-essential software-properties-common python-software-properties ipvsadm
31+
add-apt-repository -y ppa:ubuntu-lxc/lxd-stable
32+
apt-get -y update -qq
33+
apt-get install -y golang
34+
apt-get install git mercurial bzr
35+
apt-get -y autoremove
36+
SCRIPT
37+
38+
end

0 commit comments

Comments
 (0)