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.

52 lines
1.8 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. # add docker repo
  11. curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
  12. add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable"
  13. # and golang 1.9 support
  14. # official repo doesn't have race detection runtime...
  15. # add-apt-repository ppa:gophers/archive
  16. add-apt-repository ppa:longsleep/golang-backports
  17. # install base requirements
  18. apt-get update
  19. apt-get install -y --no-install-recommends wget curl jq zip \
  20. make shellcheck bsdmainutils psmisc
  21. apt-get install -y docker-ce golang-1.9-go
  22. apt-get install -y language-pack-en
  23. # cleanup
  24. apt-get autoremove -y
  25. # needed for docker
  26. usermod -a -G docker vagrant
  27. # set env variables
  28. echo 'export PATH=$PATH:/usr/lib/go-1.9/bin:/home/vagrant/go/bin' >> /home/vagrant/.bash_profile
  29. echo 'export GOPATH=/home/vagrant/go' >> /home/vagrant/.bash_profile
  30. echo 'export LC_ALL=en_US.UTF-8' >> /home/vagrant/.bash_profile
  31. echo 'cd go/src/github.com/tendermint/tendermint' >> /home/vagrant/.bash_profile
  32. mkdir -p /home/vagrant/go/bin
  33. mkdir -p /home/vagrant/go/src/github.com/tendermint
  34. ln -s /vagrant /home/vagrant/go/src/github.com/tendermint/tendermint
  35. chown -R vagrant:vagrant /home/vagrant/go
  36. chown vagrant:vagrant /home/vagrant/.bash_profile
  37. # get all deps and tools, ready to install/test
  38. su - vagrant -c 'source /home/vagrant/.bash_profile'
  39. su - vagrant -c 'cd /home/vagrant/go/src/github.com/tendermint/tendermint && make get_tools && make get_vendor_deps'
  40. SHELL
  41. end