From 88171a8ab245ffc81f13bcb6085ca8d42535aeb5 Mon Sep 17 00:00:00 2001 From: Adrian Brink Date: Thu, 18 Jan 2018 12:30:05 +0100 Subject: [PATCH] Vagrantfile --- .gitignore | 7 ++++++- Vagrantfile | 52 +++++++++++++++++++++++++++++++++------------------- 2 files changed, 39 insertions(+), 20 deletions(-) diff --git a/.gitignore b/.gitignore index 80a28eb1e0..5d00728ceb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,14 @@ *.swp *.swo vendor -.vagrant merkleeyes.db build docs/guide/*.sh tools/bin/* examples/build/* + +### Vagrant ### +.vagrant/ +*.box +*.log +vagrant diff --git a/Vagrantfile b/Vagrantfile index 4de164c979..d90015bdcf 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -2,7 +2,7 @@ # vi: set ft=ruby : Vagrant.configure("2") do |config| - config.vm.box = "ubuntu/trusty64" + config.vm.box = "ubuntu/xenial64" config.vm.provider "virtualbox" do |v| v.memory = 4096 @@ -10,29 +10,43 @@ Vagrant.configure("2") do |config| end config.vm.provision "shell", inline: <<-SHELL - apt-get update - apt-get install -y --no-install-recommends wget curl jq shellcheck bsdmainutils psmisc zip - wget -qO- https://get.docker.com/ | sh - usermod -a -G docker vagrant + # add docker repo + curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - + add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable" + + # and golang 1.9 support + # official repo doesn't have race detection runtime... + #add-apt-repository ppa:gophers/archive + add-apt-repository ppa:longsleep/golang-backports + + # install base requirements + apt-get update + apt-get upgrade -y + apt-get install -y --no-install-recommends wget curl jq \ + make shellcheck bsdmainutils psmisc golang-1.9-go docker-ce + + # needed for docker + usermod -a -G docker ubuntu + + # cleanup apt-get autoremove -y - curl -O https://storage.googleapis.com/golang/go1.8.linux-amd64.tar.gz - tar -xvf go1.8.linux-amd64.tar.gz - rm -rf /usr/local/go - mv go /usr/local - rm -f go1.8.linux-amd64.tar.gz - mkdir -p /home/vagrant/go/bin - echo 'export PATH=$PATH:/usr/local/go/bin:/home/vagrant/go/bin' >> /home/vagrant/.bash_profile - echo 'export GOPATH=/home/vagrant/go' >> /home/vagrant/.bash_profile + # use "EOF" not EOF to avoid variable substitution of $PATH + cat << "EOF" >> /home/ubuntu/.bash_profile +export PATH=$PATH:/usr/lib/go-1.9/bin:/home/ubuntu/go/bin +export GOPATH=/home/ubuntu/go +export LC_ALL=en_US.UTF-8 +cd go/src/github.com/cosmos/cosmos-sdk +EOF - echo 'export LC_ALL=en_US.UTF-8' >> /home/vagrant/.bash_profile + mkdir -p /home/ubuntu/go/bin + mkdir -p /home/ubuntu/go/src/github.com/cosmos + ln -s /vagrant /home/ubuntu/go/src/github.com/cosmos/cosmos-sdk - mkdir -p /home/vagrant/go/src/github.com/tendermint - ln -s /vagrant /home/vagrant/go/src/github.com/tendermint/basecoin + chown -R ubuntu:ubuntu /home/ubuntu/go + chown ubuntu:ubuntu /home/ubuntu/.bash_profile - chown -R vagrant:vagrant /home/vagrant/go - - rm -rf /home/vagrant/go/src/github.com/tendermint/basecoin/vendor + su - ubuntu -c 'cd /home/ubuntu/go/src/github.com/cosmos/cosmos-sdk && make get_tools' SHELL end