diff options
author | Koustubh Sinkar <ksinkar@users.noreply.github.com> | 2017-05-13 07:59:03 +0800 |
---|---|---|
committer | Felix Lange <fjl@users.noreply.github.com> | 2017-05-13 07:59:03 +0800 |
commit | df4e7eccf5b6d59573ba1ebde5ef04b2ef68cef6 (patch) | |
tree | 116365d35e6e2574ba5b8b922b7c2d13ab04e187 /containers | |
parent | 7c707d14d16220d9b73af3a4dcd437afb5a10673 (diff) | |
download | dexon-df4e7eccf5b6d59573ba1ebde5ef04b2ef68cef6.tar dexon-df4e7eccf5b6d59573ba1ebde5ef04b2ef68cef6.tar.gz dexon-df4e7eccf5b6d59573ba1ebde5ef04b2ef68cef6.tar.bz2 dexon-df4e7eccf5b6d59573ba1ebde5ef04b2ef68cef6.tar.lz dexon-df4e7eccf5b6d59573ba1ebde5ef04b2ef68cef6.tar.xz dexon-df4e7eccf5b6d59573ba1ebde5ef04b2ef68cef6.tar.zst dexon-df4e7eccf5b6d59573ba1ebde5ef04b2ef68cef6.zip |
containers/vagrant: add support for CentOS (#14380)
CentOS has been added as a multi-machine option to the Vagrant script.
Ubuntu is still the default option. For starting the CentOS machine, use:
vagrant up centos
Diffstat (limited to 'containers')
-rw-r--r-- | containers/vagrant/.gitignore | 1 | ||||
-rw-r--r-- | containers/vagrant/Vagrantfile | 47 | ||||
-rwxr-xr-x | containers/vagrant/provisioners/shell/centos.sh | 11 | ||||
-rwxr-xr-x | containers/vagrant/provisioners/shell/debian.sh | 11 | ||||
-rwxr-xr-x | containers/vagrant/provisioners/shell/ubuntu.sh | 11 |
5 files changed, 62 insertions, 19 deletions
diff --git a/containers/vagrant/.gitignore b/containers/vagrant/.gitignore new file mode 100644 index 000000000..8000dd9db --- /dev/null +++ b/containers/vagrant/.gitignore @@ -0,0 +1 @@ +.vagrant diff --git a/containers/vagrant/Vagrantfile b/containers/vagrant/Vagrantfile index 5d263eb76..72ec366e2 100644 --- a/containers/vagrant/Vagrantfile +++ b/containers/vagrant/Vagrantfile @@ -1,29 +1,38 @@ # -*- mode: ruby -*- # vi: set ft=ruby : -Vagrant.configure(2) do |config| - config.vm.box = "ubuntu/trusty64" +require 'yaml' - config.vm.provider "virtualbox" do |vb| - vb.memory = "2048" - end - - config.vm.synced_folder "../../", "/home/vagrant/go/src/github.com/ethereum/go-ethereum" - config.vm.synced_folder ".", "/vagrant", disabled: true +VAGRANTFILE_API_VERSION = 2 +VM_RAM = 2048 - config.vm.provision "shell", inline: <<-SHELL - sudo apt-get install software-properties-common - sudo add-apt-repository -y ppa:ethereum/ethereum - sudo add-apt-repository -y ppa:ethereum/ethereum-dev - sudo apt-get update +Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| - sudo apt-get install -y build-essential golang git-all + config.vm.define "ubuntu", :primary => true do |ubuntu| + ubuntu.vm.box = "ubuntu/trusty64" + ubuntu.vm.provision "shell", :path => "provisioners/shell/ubuntu.sh" + end - GOPATH=/home/vagrant/go go get github.com/tools/godep + config.vm.define "debian", :primary => true do |debian| + debian.vm.box = "debian/jessie64" + debian.vm.provision "shell", :path => "provisioners/shell/debian.sh" + end + + config.vm.define "centos", :autostart => false do |centos| + centos.vm.box = "centos/7" + centos.vm.provision "shell", :path => "provisioners/shell/centos.sh" + end + + config.vm.provider "virtualbox" do |vb| + vb.memory = VM_RAM + end - sudo chown -R vagrant:vagrant ~vagrant/go + config.vm.provider "libvirt" do |lv| + lv.memory = VM_RAM - echo "export GOPATH=/home/vagrant/go" >> ~vagrant/.bashrc - echo "export PATH=\\\$PATH:\\\$GOPATH/bin:/usr/local/go/bin" >> ~vagrant/.bashrc - SHELL + config.vm.synced_folder ".", "/home/vagrant/sync", :disabled => true + end + + config.vm.synced_folder ".", "/vagrant", :disabled => true + config.vm.synced_folder "../../", "/home/vagrant/go/src/github.com/ethereum/go-ethereum" end diff --git a/containers/vagrant/provisioners/shell/centos.sh b/containers/vagrant/provisioners/shell/centos.sh new file mode 100755 index 000000000..744da4bfd --- /dev/null +++ b/containers/vagrant/provisioners/shell/centos.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +sudo yum install -y git wget +sudo yum update -y + +wget --continue https://storage.googleapis.com/golang/go1.8.1.linux-amd64.tar.gz +sudo tar -C /usr/local -xzf go1.8.1.linux-amd64.tar.gz + +GETH_PATH="~vagrant/go/src/github.com/ethereum/go-ethereum/build/bin/" + +echo "export PATH=$PATH:/usr/local/go/bin:$GETH_PATH" >> ~vagrant/.bashrc diff --git a/containers/vagrant/provisioners/shell/debian.sh b/containers/vagrant/provisioners/shell/debian.sh new file mode 100755 index 000000000..1c1793336 --- /dev/null +++ b/containers/vagrant/provisioners/shell/debian.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +sudo apt-get install -y build-essential git-all wget +sudo apt-get update + +wget --continue https://storage.googleapis.com/golang/go1.8.1.linux-amd64.tar.gz +sudo tar -C /usr/local -xzf go1.8.1.linux-amd64.tar.gz + +GETH_PATH="~vagrant/go/src/github.com/ethereum/go-ethereum/build/bin/" + +echo "export PATH=$PATH:/usr/local/go/bin:$GETH_PATH" >> ~vagrant/.bashrc diff --git a/containers/vagrant/provisioners/shell/ubuntu.sh b/containers/vagrant/provisioners/shell/ubuntu.sh new file mode 100755 index 000000000..1c1793336 --- /dev/null +++ b/containers/vagrant/provisioners/shell/ubuntu.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +sudo apt-get install -y build-essential git-all wget +sudo apt-get update + +wget --continue https://storage.googleapis.com/golang/go1.8.1.linux-amd64.tar.gz +sudo tar -C /usr/local -xzf go1.8.1.linux-amd64.tar.gz + +GETH_PATH="~vagrant/go/src/github.com/ethereum/go-ethereum/build/bin/" + +echo "export PATH=$PATH:/usr/local/go/bin:$GETH_PATH" >> ~vagrant/.bashrc |