-
Notifications
You must be signed in to change notification settings - Fork 1
/
Vagrantfile
69 lines (54 loc) · 1.8 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
Vagrant.configure("2") do |config|
config.vm.box = "centos/7"
config.vm.network "private_network", type: "dhcp"
config.vm.provider "virtualbox" do |v|
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
v.name = "fuse_builder"
v.memory = 16384
v.cpus = 6
end
config.vm.provision "shell", inline: <<-BASH
# install fuse
sudo yum install -y curl fuse* afuse git
sudo modprobe fuse
# install go
if [ ! -f /usr/local/go/bin/go ]; then
curl -O -L https://dl.google.com/go/go1.12.linux-amd64.tar.gz
tar -C /usr/local -xzf go1.12.linux-amd64.tar.gz
echo "export PATH=/usr/local/go/bin:/root/go/bin:\$PATH" >> /etc/profile
echo "export GOROOT=/usr/local/go" >> /etc/profile
. /etc/profile
go version
mkdir -p /root/go/src /root/go/bin /home/vagrant/go/src /home/vagrant/go/bin
fi
# install dep
if [ ! -f /usr/local/go/bin/dep ]; then
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | INSTALL_DIRECTORY=/usr/local/go/bin sh
dep version
fi
# rm -rf /home/vagrant/go/src/docs-fuse
# rsync -avz \
# --exclude '.vagrant' \
# --exclude '.git' \
# --exclude '.idea' \
# --exclude 'vendor' \
# /vagrant/ /home/vagrant/go/src/docs-fuse
#
# cd /home/vagrant/go/src/docs-fuse
# chown vagrant:vagrant -R /home/vagrant/go/
# sudo su vagrant
# . /etc/profile
rm -rf /root/go/src/docs-fuse
rsync -avz \
--exclude '.vagrant' \
--exclude '.git' \
--exclude '.idea' \
--exclude 'vendor' \
/vagrant/ /root/go/src/docs-fuse
cd /root/go/src/docs-fuse
dep ensure
go build -o docs.fuse cmd/docs-fuse-raw/main.go
mkdir -p /mnt/sismics
./docs.fuse -d /mnt/sismics
BASH
end