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.

62 lines
2.1 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.12.linux-amd64.tar.gz
  27. tar -xvf go1.12.linux-amd64.tar.gz
  28. mv go /usr/local
  29. rm -f go1.12.linux-amd64.tar.gz
  30. # install nodejs (for docs)
  31. curl -sL https://deb.nodesource.com/setup_11.x | bash -
  32. apt-get install -y nodejs
  33. # cleanup
  34. apt-get autoremove -y
  35. # set env variables
  36. echo 'export GOROOT=/usr/local/go' >> /home/vagrant/.bash_profile
  37. echo 'export GOPATH=/home/vagrant/go' >> /home/vagrant/.bash_profile
  38. echo 'export PATH=$PATH:$GOROOT/bin:$GOPATH/bin' >> /home/vagrant/.bash_profile
  39. echo 'export LC_ALL=en_US.UTF-8' >> /home/vagrant/.bash_profile
  40. echo 'cd go/src/github.com/tendermint/tendermint' >> /home/vagrant/.bash_profile
  41. mkdir -p /home/vagrant/go/bin
  42. mkdir -p /home/vagrant/go/src/github.com/tendermint
  43. ln -s /vagrant /home/vagrant/go/src/github.com/tendermint/tendermint
  44. chown -R vagrant:vagrant /home/vagrant/go
  45. chown vagrant:vagrant /home/vagrant/.bash_profile
  46. # get all deps and tools, ready to install/test
  47. su - vagrant -c 'source /home/vagrant/.bash_profile'
  48. su - vagrant -c 'cd /home/vagrant/go/src/github.com/tendermint/tendermint && make get_tools && make get_vendor_deps'
  49. SHELL
  50. end