Vagrantfile

This commit is contained in:
Adrian Brink 2018-01-18 12:30:05 +01:00 committed by Ethan Buchman
parent 48cc398266
commit 88171a8ab2
2 changed files with 39 additions and 20 deletions

7
.gitignore vendored
View File

@ -1,9 +1,14 @@
*.swp
*.swo
vendor
.vagrant
merkleeyes.db
build
docs/guide/*.sh
tools/bin/*
examples/build/*
### Vagrant ###
.vagrant/
*.box
*.log
vagrant

52
Vagrantfile vendored
View File

@ -2,7 +2,7 @@
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.box = "ubuntu/xenial64"
config.vm.provider "virtualbox" do |v|
v.memory = 4096
@ -10,29 +10,43 @@ Vagrant.configure("2") do |config|
end
config.vm.provision "shell", inline: <<-SHELL
apt-get update
apt-get install -y --no-install-recommends wget curl jq shellcheck bsdmainutils psmisc zip
wget -qO- https://get.docker.com/ | sh
usermod -a -G docker vagrant
# add docker repo
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable"
# and golang 1.9 support
# official repo doesn't have race detection runtime...
#add-apt-repository ppa:gophers/archive
add-apt-repository ppa:longsleep/golang-backports
# install base requirements
apt-get update
apt-get upgrade -y
apt-get install -y --no-install-recommends wget curl jq \
make shellcheck bsdmainutils psmisc golang-1.9-go docker-ce
# needed for docker
usermod -a -G docker ubuntu
# cleanup
apt-get autoremove -y
curl -O https://storage.googleapis.com/golang/go1.8.linux-amd64.tar.gz
tar -xvf go1.8.linux-amd64.tar.gz
rm -rf /usr/local/go
mv go /usr/local
rm -f go1.8.linux-amd64.tar.gz
mkdir -p /home/vagrant/go/bin
echo 'export PATH=$PATH:/usr/local/go/bin:/home/vagrant/go/bin' >> /home/vagrant/.bash_profile
echo 'export GOPATH=/home/vagrant/go' >> /home/vagrant/.bash_profile
# use "EOF" not EOF to avoid variable substitution of $PATH
cat << "EOF" >> /home/ubuntu/.bash_profile
export PATH=$PATH:/usr/lib/go-1.9/bin:/home/ubuntu/go/bin
export GOPATH=/home/ubuntu/go
export LC_ALL=en_US.UTF-8
cd go/src/github.com/cosmos/cosmos-sdk
EOF
echo 'export LC_ALL=en_US.UTF-8' >> /home/vagrant/.bash_profile
mkdir -p /home/ubuntu/go/bin
mkdir -p /home/ubuntu/go/src/github.com/cosmos
ln -s /vagrant /home/ubuntu/go/src/github.com/cosmos/cosmos-sdk
mkdir -p /home/vagrant/go/src/github.com/tendermint
ln -s /vagrant /home/vagrant/go/src/github.com/tendermint/basecoin
chown -R ubuntu:ubuntu /home/ubuntu/go
chown ubuntu:ubuntu /home/ubuntu/.bash_profile
chown -R vagrant:vagrant /home/vagrant/go
rm -rf /home/vagrant/go/src/github.com/tendermint/basecoin/vendor
su - ubuntu -c 'cd /home/ubuntu/go/src/github.com/cosmos/cosmos-sdk && make get_tools'
SHELL
end