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.

49 lines
1.6 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 \
  20. make shellcheck bsdmainutils psmisc
  21. apt-get install -y docker-ce golang-1.9-go
  22. # needed for docker
  23. usermod -a -G docker ubuntu
  24. # use "EOF" not EOF to avoid variable substitution of $PATH
  25. cat << "EOF" >> /home/ubuntu/.bash_profile
  26. export PATH=$PATH:/usr/lib/go-1.9/bin:/home/ubuntu/go/bin
  27. export GOPATH=/home/ubuntu/go
  28. export LC_ALL=en_US.UTF-8
  29. cd go/src/github.com/tendermint/tendermint
  30. EOF
  31. mkdir -p /home/ubuntu/go/bin
  32. mkdir -p /home/ubuntu/go/src/github.com/tendermint
  33. ln -s /vagrant /home/ubuntu/go/src/github.com/tendermint/tendermint
  34. chown -R ubuntu:ubuntu /home/ubuntu/go
  35. chown ubuntu:ubuntu /home/ubuntu/.bash_profile
  36. # get all deps and tools, ready to install/test
  37. su - ubuntu -c 'cd /home/ubuntu/go/src/github.com/tendermint/tendermint && make get_vendor_deps && make tools'
  38. SHELL
  39. end