forked from miladmostavi/gnosis-contracts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
84 lines (71 loc) · 2.4 KB
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# -*- mode: ruby -*-
# vi: set ft=ruby :
$ethereumcpp = <<SCRIPT
if ! which eth | grep -q /usr/bin/eth || ! which solc | grep -q /usr/bin/solc; then
DEBIAN_FRONTEND=noninteractive sudo apt-get install -y software-properties-common
DEBIAN_FRONTEND=noninteractive sudo add-apt-repository -y ppa:ethereum/ethereum
DEBIAN_FRONTEND=noninteractive sudo add-apt-repository -y ppa:ethereum/ethereum-dev
DEBIAN_FRONTEND=noninteractive sudo apt-get update
fi
DEBIAN_FRONTEND=noninteractive sudo apt-get install -y solc
SCRIPT
$fucking_locale = <<SCRIPT
locale-gen en_US en_US.UTF-8 pt_BR.UTF-8 de_DE.UTF-8
dpkg-reconfigure locales
SCRIPT
$dependencies = <<SCRIPT
DEBIAN_FRONTEND=noninteractive apt-get update
# pyenv
DEBIAN_FRONTEND=noninteractive apt-get install -y curl python-dev \
libreadline-dev libbz2-dev libssl-dev libsqlite3-dev libxslt1-dev \
libxml2-dev libxslt1-dev git python-pip build-essential automake libtool libffi-dev libgmp-dev pkg-config
SCRIPT
$pyenv = <<SCRIPT
if [ ! -d ~/.pyenv ]; then
pip install --egg pyenv
else
. ~/.bash_profile
pyenv update
fi
if [ ! -f ~/.bash_profile ]; then
touch ~/.bash_profile
fi
if ! grep -q pyenv ~/.bash_profile; then
echo '
# pyenv
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
export PYENV_VIRTUALENVWRAPPER_PREFER_PYVENV="true"
' >> ~/.bash_profile
fi
. ~/.bash_profile
pyenv install 2.7.9
pyenv rehash
pyenv global 2.7.9
SCRIPT
$requirements = <<SCRIPT
pip install --upgrade pip
pip install -r /vagrant/requirements.txt
SCRIPT
$node_dependencies = <<SCRIPT
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
apt-get install -y nodejs
npm install -g git+https://github.com/ethereumjs/testrpc
npm install -g mocha
SCRIPT
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.provider "virtualbox" do |v|
v.memory = 3072
v.cpus = 2
end
config.ssh.forward_agent = true
config.vm.network :forwarded_port, host: 8545, guest: 8545
config.vm.provision "shell", inline: $dependencies
config.vm.provision "shell", inline: $ethereumcpp
config.vm.provision "shell", inline: $fucking_locale
config.vm.provision "shell", inline: $pyenv, privileged: false
config.vm.provision "shell", inline: $requirements, privileged: false
config.vm.provision "shell", inline: $node_dependencies, privileged: true
end