Merge pull request #201 from ThomasWaldmann/vagrant

Vagrant updates
This commit is contained in:
TW 2015-09-13 23:56:44 +02:00
commit 4030b4d9ea
1 changed files with 49 additions and 7 deletions

56
Vagrantfile vendored
View File

@ -15,6 +15,22 @@ def packages_prepare_precise
EOF
end
def packages_centos
return <<-EOF
yum install -y epel-release
yum update -y
yum install -y python34 python34-devel
ln -s /usr/bin/python3.4 /usr/bin/python3
yum install -y openssl-devel openssl
yum install -y libacl-devel libacl
yum install -y lz4-devel
yum install -y fuse-devel fuse pkgconfig
yum install -y fakeroot gcc git
yum install -y python-pip
pip install virtualenv
EOF
end
def packages_debianoid
return <<-EOF
apt-get update
@ -49,11 +65,26 @@ end
def packages_darwin
return <<-EOF
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew update || brew update
brew outdated openssl || brew upgrade openssl
brew outdated pyenv || brew upgrade pyenv
brew update
# this installs osxfuse 2.8.0 (which is based on libfuse 2.7.3).
# llfuse later complains about needing (libfuse) 2.8.0 at least.
#brew install caskroom/cask/brew-cask
#brew cask install osxfuse # needs cask install because of apple's unsigned kext ban
# get osxfuse 3.0.x pre-release code from github:
curl https://github.com/osxfuse/osxfuse/releases/download/osxfuse-3.0.5/osxfuse-3.0.5.dmg -L >osxfuse.dmg
MOUNTDIR=$(echo `hdiutil mount osxfuse.dmg | tail -1 | awk '{$1="" ; print $0}'` | xargs -0 echo) \
&& sudo installer -pkg "${MOUNTDIR}/Extras/FUSE for OS X 3.0.5.pkg" -target /
brew install openssl
brew install lz4
brew install osxfuse
# looks dirty, is there a better way without root?:
mkdir -p /usr/local/opt/lz4
ln -s /usr/local/Cellar/lz4/r*/include /usr/local/opt/lz4/
ln -s /usr/local/Cellar/lz4/r*/lib /usr/local/opt/lz4/
brew install fakeroot
brew install pyenv
if which pyenv > /dev/null; then
eval "$(pyenv init -)"
fi
pyenv install 3.4.3
pyenv global 3.4.3
pyenv rehash
@ -66,8 +97,13 @@ def prepare_user(boxname)
echo export 'PATH=/usr/local/bin:$PATH' >> ~/.profile
. ~/.profile
# initialize python on darwin
if which pyenv > /dev/null; then
eval "$(pyenv init -)"
fi
cd /vagrant/borg
virtualenv --python=python3 borg-env
python -m virtualenv --python=python3 borg-env
. borg-env/bin/activate
cd borg
@ -99,10 +135,16 @@ Vagrant.configure(2) do |config|
config.vm.provision "fix perms", :type => :shell, :inline => fix_perms
config.vm.provider :virtualbox do |v|
v.gui = false
#v.gui = true
v.cpus = 2
end
config.vm.define "centos7" do |b|
b.vm.box = "centos/7"
b.vm.provision "packages centos7 64", :type => :shell, :inline => packages_centos
b.vm.provision "prepare user", :type => :shell, :privileged => false, :inline => prepare_user("centos7_64")
end
config.vm.define "trusty64" do |b|
b.vm.box = "ubuntu/trusty64"
b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid
@ -136,7 +178,7 @@ Vagrant.configure(2) do |config|
b.vm.provision "prepare user", :type => :shell, :privileged => false, :inline => prepare_user("freebsd")
end
# OS X - TODO: make rsync/ssh work
# OS X
config.vm.define "darwin" do |b|
b.vm.box = "jhcook/yosemite-clitools"
b.vm.provision "packages darwin", :type => :shell, :privileged => false, :inline => packages_darwin