You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
2.0 KiB

  1. # -*- mode: ruby -*-
  2. # vi: set ft=ruby :
  3. Vagrant.configure("2") do |config|
  4. config.vm.box = "ubuntu/xenial64"
  5. config.vm.provider "virtualbox" do |v|
  6. v.memory = 4096
  7. v.cpus = 2
  8. end
  9. config.vm.provision "shell", inline: <<-SHELL
  10. apt-get update
  11. # install base requirements
  12. apt-get install -y --no-install-recommends wget curl jq zip \
  13. make shellcheck bsdmainutils psmisc
  14. apt-get install -y language-pack-en
  15. # install docker
  16. apt-get install -y --no-install-recommends apt-transport-https \
  17. ca-certificates curl software-properties-common
  18. curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
  19. add-apt-repository \
  20. "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
  21. $(lsb_release -cs) \
  22. stable"
  23. apt-get install -y docker-ce
  24. usermod -a -G docker vagrant
  25. # install go
  26. wget -q https://dl.google.com/go/go1.11.linux-amd64.tar.gz
  27. tar -xvf go1.11.linux-amd64.tar.gz
  28. mv go /usr/local
  29. rm -f go1.11.linux-amd64.tar.gz
  30. # cleanup
  31. apt-get autoremove -y
  32. # set env variables
  33. echo 'export GOROOT=/usr/local/go' >> /home/vagrant/.bash_profile
  34. echo 'export GOPATH=/home/vagrant/go' >> /home/vagrant/.bash_profile
  35. echo 'export PATH=$PATH:$GOROOT/bin:$GOPATH/bin' >> /home/vagrant/.bash_profile
  36. echo 'export LC_ALL=en_US.UTF-8' >> /home/vagrant/.bash_profile
  37. echo 'cd go/src/github.com/tendermint/tendermint' >> /home/vagrant/.bash_profile
  38. mkdir -p /home/vagrant/go/bin
  39. mkdir -p /home/vagrant/go/src/github.com/tendermint
  40. ln -s /vagrant /home/vagrant/go/src/github.com/tendermint/tendermint
  41. chown -R vagrant:vagrant /home/vagrant/go
  42. chown vagrant:vagrant /home/vagrant/.bash_profile
  43. # get all deps and tools, ready to install/test
  44. su - vagrant -c 'source /home/vagrant/.bash_profile'
  45. su - vagrant -c 'cd /home/vagrant/go/src/github.com/tendermint/tendermint && make get_tools && make get_vendor_deps'
  46. SHELL
  47. end