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.

66 lines
2.1 KiB

  1. # -*- mode: ruby -*-
  2. # vi: set ft=ruby :
  3. Vagrant.configure("2") do |config|
  4. config.vm.box = "ubuntu/focal64"
  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 \
  18. curl \
  19. gnupg-agent \
  20. software-properties-common
  21. curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
  22. add-apt-repository \
  23. "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
  24. $(lsb_release -cs) \
  25. stable"
  26. apt-get update
  27. apt-get install -y docker-ce
  28. usermod -aG docker vagrant
  29. # install go
  30. wget -q https://dl.google.com/go/go1.15.linux-amd64.tar.gz
  31. tar -xvf go1.15.linux-amd64.tar.gz
  32. mv go /usr/local
  33. rm -f go1.15.linux-amd64.tar.gz
  34. # install nodejs (for docs)
  35. curl -sL https://deb.nodesource.com/setup_11.x | bash -
  36. apt-get install -y nodejs
  37. # cleanup
  38. apt-get autoremove -y
  39. # set env variables
  40. echo 'export GOROOT=/usr/local/go' >> /home/vagrant/.bash_profile
  41. echo 'export GOPATH=/home/vagrant/go' >> /home/vagrant/.bash_profile
  42. echo 'export PATH=$PATH:$GOROOT/bin:$GOPATH/bin' >> /home/vagrant/.bash_profile
  43. echo 'export LC_ALL=en_US.UTF-8' >> /home/vagrant/.bash_profile
  44. echo 'cd go/src/github.com/tendermint/tendermint' >> /home/vagrant/.bash_profile
  45. mkdir -p /home/vagrant/go/bin
  46. mkdir -p /home/vagrant/go/src/github.com/tendermint
  47. ln -s /vagrant /home/vagrant/go/src/github.com/tendermint/tendermint
  48. chown -R vagrant:vagrant /home/vagrant/go
  49. chown vagrant:vagrant /home/vagrant/.bash_profile
  50. # get all deps and tools, ready to install/test
  51. su - vagrant -c 'source /home/vagrant/.bash_profile'
  52. su - vagrant -c 'cd /home/vagrant/go/src/github.com/tendermint/tendermint && make tools'
  53. SHELL
  54. end