Skip to content

Commit df4e7ec

Browse files
ksinkarfjl
authored andcommitted
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
1 parent 7c707d1 commit df4e7ec

5 files changed

Lines changed: 62 additions & 19 deletions

File tree

‎containers/vagrant/.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.vagrant

‎containers/vagrant/Vagrantfile‎

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,38 @@
11
# -*- mode: ruby -*-
22
# vi: set ft=ruby :
33

4-
Vagrant.configure(2) do |config|
5-
config.vm.box = "ubuntu/trusty64"
4+
require 'yaml'
65

7-
config.vm.provider "virtualbox" do |vb|
8-
vb.memory = "2048"
9-
end
10-
11-
config.vm.synced_folder "../../", "/home/vagrant/go/src/github.com/ethereum/go-ethereum"
12-
config.vm.synced_folder ".", "/vagrant", disabled: true
6+
VAGRANTFILE_API_VERSION = 2
7+
VM_RAM = 2048
138

14-
config.vm.provision "shell", inline: <<-SHELL
15-
sudo apt-get install software-properties-common
16-
sudo add-apt-repository -y ppa:ethereum/ethereum
17-
sudo add-apt-repository -y ppa:ethereum/ethereum-dev
18-
sudo apt-get update
9+
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
1910

20-
sudo apt-get install -y build-essential golang git-all
11+
config.vm.define "ubuntu", :primary => true do |ubuntu|
12+
ubuntu.vm.box = "ubuntu/trusty64"
13+
ubuntu.vm.provision "shell", :path => "provisioners/shell/ubuntu.sh"
14+
end
2115

22-
GOPATH=/home/vagrant/go go get github.com/tools/godep
16+
config.vm.define "debian", :primary => true do |debian|
17+
debian.vm.box = "debian/jessie64"
18+
debian.vm.provision "shell", :path => "provisioners/shell/debian.sh"
19+
end
20+
21+
config.vm.define "centos", :autostart => false do |centos|
22+
centos.vm.box = "centos/7"
23+
centos.vm.provision "shell", :path => "provisioners/shell/centos.sh"
24+
end
25+
26+
config.vm.provider "virtualbox" do |vb|
27+
vb.memory = VM_RAM
28+
end
2329

24-
sudo chown -R vagrant:vagrant ~vagrant/go
30+
config.vm.provider "libvirt" do |lv|
31+
lv.memory = VM_RAM
2532

26-
echo "export GOPATH=/home/vagrant/go" >> ~vagrant/.bashrc
27-
echo "export PATH=\\\$PATH:\\\$GOPATH/bin:/usr/local/go/bin" >> ~vagrant/.bashrc
28-
SHELL
33+
config.vm.synced_folder ".", "/home/vagrant/sync", :disabled => true
34+
end
35+
36+
config.vm.synced_folder ".", "/vagrant", :disabled => true
37+
config.vm.synced_folder "../../", "/home/vagrant/go/src/github.com/ethereum/go-ethereum"
2938
end
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
sudo yum install -y git wget
4+
sudo yum update -y
5+
6+
wget --continue https://storage.googleapis.com/golang/go1.8.1.linux-amd64.tar.gz
7+
sudo tar -C /usr/local -xzf go1.8.1.linux-amd64.tar.gz
8+
9+
GETH_PATH="~vagrant/go/src/github.com/ethereum/go-ethereum/build/bin/"
10+
11+
echo "export PATH=$PATH:/usr/local/go/bin:$GETH_PATH" >> ~vagrant/.bashrc
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
sudo apt-get install -y build-essential git-all wget
4+
sudo apt-get update
5+
6+
wget --continue https://storage.googleapis.com/golang/go1.8.1.linux-amd64.tar.gz
7+
sudo tar -C /usr/local -xzf go1.8.1.linux-amd64.tar.gz
8+
9+
GETH_PATH="~vagrant/go/src/github.com/ethereum/go-ethereum/build/bin/"
10+
11+
echo "export PATH=$PATH:/usr/local/go/bin:$GETH_PATH" >> ~vagrant/.bashrc
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
sudo apt-get install -y build-essential git-all wget
4+
sudo apt-get update
5+
6+
wget --continue https://storage.googleapis.com/golang/go1.8.1.linux-amd64.tar.gz
7+
sudo tar -C /usr/local -xzf go1.8.1.linux-amd64.tar.gz
8+
9+
GETH_PATH="~vagrant/go/src/github.com/ethereum/go-ethereum/build/bin/"
10+
11+
echo "export PATH=$PATH:/usr/local/go/bin:$GETH_PATH" >> ~vagrant/.bashrc

0 commit comments

Comments
 (0)