Vagrantfile 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595
  1. # -*- mode: ruby -*-
  2. # vi: set ft=ruby :
  3. # Automated creation of testing environments / binaries on misc. platforms
  4. $cpus = Integer(ENV.fetch('VMCPUS', '4')) # create VMs with that many cpus
  5. $xdistn = Integer(ENV.fetch('XDISTN', '4')) # dispatch tests to that many pytest workers
  6. $wmem = $xdistn * 256 # give the VM additional memory for workers [MB]
  7. def packages_prepare_wheezy
  8. return <<-EOF
  9. # debian 7 wheezy does not have lz4, but it is available from wheezy-backports:
  10. echo "deb http://http.debian.net/debian wheezy-backports main" > /etc/apt/sources.list.d/wheezy-backports.list
  11. EOF
  12. end
  13. def packages_debianoid
  14. return <<-EOF
  15. if id "vagrant" >/dev/null 2>&1; then
  16. username='vagrant'
  17. home_dir=/home/vagrant
  18. else
  19. username='ubuntu'
  20. home_dir=/home/ubuntu
  21. fi
  22. apt-get update
  23. # install all the (security and other) updates
  24. apt-get dist-upgrade -y
  25. # for building borgbackup and dependencies:
  26. apt-get install -y libssl-dev libacl1-dev liblz4-dev libfuse-dev fuse pkg-config
  27. usermod -a -G fuse $username
  28. chgrp fuse /dev/fuse
  29. chmod 666 /dev/fuse
  30. apt-get install -y fakeroot build-essential git
  31. apt-get install -y python3-dev python3-setuptools
  32. # for building python:
  33. apt-get install -y zlib1g-dev libbz2-dev libncurses5-dev libreadline-dev liblzma-dev libsqlite3-dev
  34. # this way it works on older dists (like ubuntu 12.04) also:
  35. # for python 3.2 on ubuntu 12.04 we need pip<8 and virtualenv<14 as
  36. # newer versions are not compatible with py 3.2 any more.
  37. easy_install3 'pip<8.0'
  38. pip3 install 'virtualenv<14.0'
  39. touch $home_dir/.bash_profile ; chown $username $home_dir/.bash_profile
  40. EOF
  41. end
  42. def packages_redhatted
  43. return <<-EOF
  44. yum install -y epel-release
  45. yum update -y
  46. # for building borgbackup and dependencies:
  47. yum install -y openssl-devel openssl libacl-devel libacl lz4-devel fuse-devel fuse pkgconfig
  48. usermod -a -G fuse vagrant
  49. chgrp fuse /dev/fuse
  50. chmod 666 /dev/fuse
  51. yum install -y fakeroot gcc git patch
  52. # needed to compile msgpack-python (otherwise it will use slow fallback code):
  53. yum install -y gcc-c++
  54. # for building python:
  55. yum install -y zlib-devel bzip2-devel ncurses-devel readline-devel xz xz-devel sqlite-devel
  56. #yum install -y python-pip
  57. #pip install virtualenv
  58. touch ~vagrant/.bash_profile ; chown vagrant ~vagrant/.bash_profile
  59. EOF
  60. end
  61. def packages_darwin
  62. return <<-EOF
  63. # install all the (security and other) updates
  64. sudo softwareupdate --ignore iTunesX
  65. sudo softwareupdate --ignore iTunes
  66. sudo softwareupdate --install --all
  67. # get osxfuse 3.x release code from github:
  68. curl -s -L https://github.com/osxfuse/osxfuse/releases/download/osxfuse-3.6.3/osxfuse-3.6.3.dmg >osxfuse.dmg
  69. MOUNTDIR=$(echo `hdiutil mount osxfuse.dmg | tail -1 | awk '{$1="" ; print $0}'` | xargs -0 echo) \
  70. && sudo installer -pkg "${MOUNTDIR}/Extras/FUSE for macOS 3.6.3.pkg" -target /
  71. sudo chown -R vagrant /usr/local # brew must be able to create stuff here
  72. ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  73. brew update
  74. brew install openssl
  75. brew install lz4
  76. brew install xz # required for python lzma module
  77. brew install fakeroot
  78. brew install git
  79. brew install pkg-config
  80. touch ~vagrant/.bash_profile ; chown vagrant ~vagrant/.bash_profile
  81. EOF
  82. end
  83. def packages_freebsd
  84. return <<-EOF
  85. # VM has no hostname set
  86. hostname freebsd
  87. # install all the (security and other) updates, base system
  88. freebsd-update --not-running-from-cron fetch install
  89. # for building borgbackup and dependencies:
  90. pkg install -y openssl liblz4 fusefs-libs pkgconf
  91. pkg install -y git bash
  92. # for building python:
  93. pkg install -y sqlite3
  94. # make bash default / work:
  95. chsh -s bash vagrant
  96. mount -t fdescfs fdesc /dev/fd
  97. echo 'fdesc /dev/fd fdescfs rw 0 0' >> /etc/fstab
  98. # make FUSE work
  99. echo 'fuse_load="YES"' >> /boot/loader.conf
  100. echo 'vfs.usermount=1' >> /etc/sysctl.conf
  101. kldload fuse
  102. sysctl vfs.usermount=1
  103. pw groupmod operator -M vagrant
  104. # /dev/fuse has group operator
  105. chmod 666 /dev/fuse
  106. touch ~vagrant/.bash_profile ; chown vagrant ~vagrant/.bash_profile
  107. # install all the (security and other) updates, packages
  108. pkg update
  109. yes | pkg upgrade
  110. EOF
  111. end
  112. def packages_openbsd
  113. return <<-EOF
  114. echo 'installpath = http://ftp.hostserver.de/pub/OpenBSD/6.0/packages/amd64/' > /etc/pkg.conf
  115. echo 'export PKG_PATH=http://ftp.hostserver.de/pub/OpenBSD/6.0/packages/amd64/' >> ~/.profile
  116. . ~/.profile
  117. pkg_add bash
  118. chsh -s /usr/local/bin/bash vagrant
  119. pkg_add openssl
  120. pkg_add lz4
  121. pkg_add git # no fakeroot
  122. pkg_add py3-setuptools
  123. # TODO: python 3.5 or 3.6
  124. ln -sf /usr/local/bin/python3.4 /usr/local/bin/python3
  125. ln -sf /usr/local/bin/python3.4 /usr/local/bin/python
  126. easy_install-3.4 pip
  127. pip3 install virtualenv
  128. touch ~vagrant/.bash_profile ; chown vagrant ~vagrant/.bash_profile
  129. EOF
  130. end
  131. def packages_netbsd
  132. return <<-EOF
  133. hostname netbsd # the box we use has an invalid hostname
  134. PKG_PATH="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/NetBSD/amd64/6.1.5/All/"
  135. export PKG_PATH
  136. pkg_add mozilla-rootcerts lz4 git bash
  137. chsh -s bash vagrant
  138. mkdir -p /usr/local/opt/lz4/include
  139. mkdir -p /usr/local/opt/lz4/lib
  140. ln -s /usr/pkg/include/lz4*.h /usr/local/opt/lz4/include/
  141. ln -s /usr/pkg/lib/liblz4* /usr/local/opt/lz4/lib/
  142. touch /etc/openssl/openssl.cnf # avoids a flood of "can't open ..."
  143. mozilla-rootcerts install
  144. pkg_add pkg-config # avoids some "pkg-config missing" error msg, even without fuse pkg
  145. # pkg_add fuse # llfuse supports netbsd, but is still buggy.
  146. # https://bitbucket.org/nikratio/python-llfuse/issues/70/perfuse_open-setsockopt-no-buffer-space
  147. # TODO: python 3.5 or 3.6
  148. pkg_add python34 py34-setuptools
  149. ln -s /usr/pkg/bin/python3.4 /usr/pkg/bin/python
  150. ln -s /usr/pkg/bin/python3.4 /usr/pkg/bin/python3
  151. easy_install-3.4 pip
  152. pip install virtualenv
  153. touch ~vagrant/.bash_profile ; chown vagrant ~vagrant/.bash_profile
  154. EOF
  155. end
  156. def packages_openindiana
  157. return <<-EOF
  158. #pkg update # XXX needs separate provisioning step + reboot
  159. # TODO python 3.5 or 3.6
  160. pkg install python-34 clang-3.4 lz4 git
  161. python3 -m ensurepip
  162. pip3 install -U setuptools pip wheel virtualenv
  163. touch ~vagrant/.bash_profile ; chown vagrant ~vagrant/.bash_profile
  164. EOF
  165. end
  166. # Install required cygwin packages and configure environment
  167. #
  168. # Microsoft/EdgeOnWindows10 image has MLS-OpenSSH installed by default,
  169. # which is based on cygwin x86_64 but should not be used together with cygwin.
  170. # In order to have have cygwin compatible bash 'ImagePath' is replaced with
  171. # cygrunsrv of newly installed cygwin
  172. #
  173. # supported cygwin versions:
  174. # x86_64
  175. # x86
  176. def packages_cygwin(version)
  177. setup_exe = "setup-#{version}.exe"
  178. return <<-EOF
  179. mkdir -p /cygdrive/c/cygwin
  180. powershell -Command '$client = new-object System.Net.WebClient; $client.DownloadFile("https://www.cygwin.com/#{setup_exe}","C:\\cygwin\\#{setup_exe}")'
  181. echo '
  182. REM --- Change to use different CygWin platform and final install path
  183. set CYGSETUP=#{setup_exe}
  184. REM --- Install build version of CygWin in a subfolder
  185. set OURPATH=%cd%
  186. set CYGBUILD="C:\\cygwin\\CygWin"
  187. set CYGMIRROR=http://mirrors.kernel.org/sourceware/cygwin/
  188. set BASEPKGS=openssh,rsync
  189. set BUILDPKGS=python3,python3-setuptools,python-devel,binutils,gcc-g++,libopenssl,openssl-devel,git,make,liblz4-devel,liblz4_1,curl
  190. %CYGSETUP% -q -B -o -n -R %CYGBUILD% -L -D -s %CYGMIRROR% -P %BASEPKGS%,%BUILDPKGS%
  191. cd /d C:\\cygwin\\CygWin\\bin
  192. regtool set /HKLM/SYSTEM/CurrentControlSet/Services/OpenSSHd/ImagePath "C:\\cygwin\\CygWin\\bin\\cygrunsrv.exe"
  193. bash -c "ssh-host-config --no"
  194. bash -c "chown sshd_server /cygdrive/c/cygwin/CygWin/var/empty"
  195. ' > /cygdrive/c/cygwin/install.bat
  196. echo "alias mkdir='mkdir -p'" > ~/.profile
  197. echo "export CYGWIN_ROOT=/cygdrive/c/cygwin/CygWin" >> ~/.profile
  198. echo 'export PATH=$CYGWIN_ROOT/bin:$PATH' >> ~/.profile
  199. echo '' > ~/.bash_profile
  200. cmd.exe /c 'setx /m PATH "C:\\cygwin\\CygWin\\bin;%PATH%"'
  201. source ~/.profile
  202. cd /cygdrive/c/cygwin && cmd.exe /c install.bat
  203. echo 'db_home: windows' > $CYGWIN_ROOT/etc/nsswitch.conf
  204. EOF
  205. end
  206. def install_cygwin_venv
  207. return <<-EOF
  208. python3 -m ensurepip -U --default-pip
  209. pip install virtualenv
  210. EOF
  211. end
  212. def install_pyenv(boxname)
  213. script = <<-EOF
  214. curl -s -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash
  215. echo 'export PATH="$HOME/.pyenv/bin:/vagrant/borg:$PATH"' >> ~/.bash_profile
  216. echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
  217. echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bash_profile
  218. echo 'export PYTHON_CONFIGURE_OPTS="--enable-shared"' >> ~/.bash_profile
  219. echo 'export LANG=en_US.UTF-8' >> ~/.bash_profile
  220. EOF
  221. script += "echo 'export XDISTN=%d' >> ~/.bash_profile\n" % [$xdistn]
  222. return script
  223. end
  224. def fix_pyenv_darwin(boxname)
  225. return <<-EOF
  226. echo 'export PYTHON_CONFIGURE_OPTS="--enable-framework"' >> ~/.bash_profile
  227. EOF
  228. end
  229. def install_pythons(boxname)
  230. return <<-EOF
  231. . ~/.bash_profile
  232. pyenv install 3.5.0 # tests
  233. pyenv install 3.6.0 # tests
  234. pyenv install 3.5.3 # binary build, use latest 3.5.x release
  235. pyenv rehash
  236. EOF
  237. end
  238. def build_sys_venv(boxname)
  239. return <<-EOF
  240. . ~/.bash_profile
  241. cd /vagrant/borg
  242. virtualenv --python=python3 borg-env
  243. EOF
  244. end
  245. def build_pyenv_venv(boxname)
  246. return <<-EOF
  247. . ~/.bash_profile
  248. cd /vagrant/borg
  249. # use the latest 3.5 release
  250. pyenv global 3.5.3
  251. pyenv virtualenv 3.5.3 borg-env
  252. ln -s ~/.pyenv/versions/borg-env .
  253. EOF
  254. end
  255. def install_borg(fuse)
  256. script = <<-EOF
  257. . ~/.bash_profile
  258. cd /vagrant/borg
  259. . borg-env/bin/activate
  260. pip install -U wheel # upgrade wheel, too old for 3.5
  261. cd borg
  262. # clean up (wrong/outdated) stuff we likely got via rsync:
  263. rm -rf __pycache__
  264. find src -name '__pycache__' -exec rm -rf {} \\;
  265. pip install -r requirements.d/development.txt
  266. python setup.py clean
  267. EOF
  268. if fuse
  269. script += <<-EOF
  270. # by using [fuse], setup.py can handle different FUSE requirements:
  271. pip install -e .[fuse]
  272. EOF
  273. else
  274. script += <<-EOF
  275. pip install -e .
  276. # do not install llfuse into the virtualenvs built by tox:
  277. sed -i.bak '/fuse.txt/d' tox.ini
  278. EOF
  279. end
  280. return script
  281. end
  282. def install_pyinstaller()
  283. return <<-EOF
  284. . ~/.bash_profile
  285. cd /vagrant/borg
  286. . borg-env/bin/activate
  287. git clone https://github.com/thomaswaldmann/pyinstaller.git
  288. cd pyinstaller
  289. git checkout v3.2.1
  290. python setup.py install
  291. EOF
  292. end
  293. def build_binary_with_pyinstaller(boxname)
  294. return <<-EOF
  295. . ~/.bash_profile
  296. cd /vagrant/borg
  297. . borg-env/bin/activate
  298. cd borg
  299. pyinstaller --clean --distpath=/vagrant/borg scripts/borg.exe.spec
  300. EOF
  301. end
  302. def run_tests(boxname)
  303. return <<-EOF
  304. . ~/.bash_profile
  305. cd /vagrant/borg/borg
  306. . ../borg-env/bin/activate
  307. if which pyenv 2> /dev/null; then
  308. # for testing, use the earliest point releases of the supported python versions:
  309. pyenv global 3.5.0 3.6.0
  310. pyenv local 3.5.0 3.6.0
  311. fi
  312. # otherwise: just use the system python
  313. if which fakeroot 2> /dev/null; then
  314. echo "Running tox WITH fakeroot -u"
  315. fakeroot -u tox --skip-missing-interpreters
  316. else
  317. echo "Running tox WITHOUT fakeroot -u"
  318. tox --skip-missing-interpreters
  319. fi
  320. EOF
  321. end
  322. def fix_perms
  323. return <<-EOF
  324. # . ~/.profile
  325. if id "vagrant" >/dev/null 2>&1; then
  326. chown -R vagrant /vagrant/borg
  327. else
  328. chown -R ubuntu /vagrant/borg
  329. fi
  330. EOF
  331. end
  332. Vagrant.configure(2) do |config|
  333. # use rsync to copy content to the folder
  334. config.vm.synced_folder ".", "/vagrant/borg/borg", :type => "rsync", :rsync__args => ["--verbose", "--archive", "--delete", "-z"], :rsync__chown => false
  335. # do not let the VM access . on the host machine via the default shared folder!
  336. config.vm.synced_folder ".", "/vagrant", disabled: true
  337. # fix permissions on synced folder
  338. config.vm.provision "fix perms", :type => :shell, :inline => fix_perms
  339. config.vm.provider :virtualbox do |v|
  340. #v.gui = true
  341. v.cpus = $cpus
  342. end
  343. # Linux
  344. config.vm.define "centos7_64" do |b|
  345. b.vm.box = "centos/7"
  346. b.vm.provider :virtualbox do |v|
  347. v.memory = 1024 + $wmem
  348. end
  349. b.vm.provision "install system packages", :type => :shell, :inline => packages_redhatted
  350. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("centos7_64")
  351. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("centos7_64")
  352. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("centos7_64")
  353. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
  354. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("centos7_64")
  355. end
  356. config.vm.define "centos6_32" do |b|
  357. b.vm.box = "centos6-32"
  358. b.vm.provider :virtualbox do |v|
  359. v.memory = 768 + $wmem
  360. end
  361. b.vm.provision "install system packages", :type => :shell, :inline => packages_redhatted
  362. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("centos6_32")
  363. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("centos6_32")
  364. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("centos6_32")
  365. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(false)
  366. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("centos6_32")
  367. end
  368. config.vm.define "centos6_64" do |b|
  369. b.vm.box = "centos6-64"
  370. b.vm.provider :virtualbox do |v|
  371. v.memory = 1024 + $wmem
  372. end
  373. b.vm.provision "install system packages", :type => :shell, :inline => packages_redhatted
  374. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("centos6_64")
  375. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("centos6_64")
  376. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("centos6_64")
  377. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(false)
  378. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("centos6_64")
  379. end
  380. config.vm.define "xenial64" do |b|
  381. b.vm.box = "ubuntu/xenial64"
  382. b.vm.provider :virtualbox do |v|
  383. v.memory = 1024 + $wmem
  384. end
  385. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid
  386. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("xenial64")
  387. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
  388. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("xenial64")
  389. end
  390. config.vm.define "trusty64" do |b|
  391. b.vm.box = "ubuntu/trusty64"
  392. b.vm.provider :virtualbox do |v|
  393. v.memory = 1024 + $wmem
  394. end
  395. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid
  396. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("trusty64")
  397. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
  398. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("trusty64")
  399. end
  400. config.vm.define "stretch64" do |b|
  401. b.vm.box = "debian/stretch64"
  402. b.vm.provider :virtualbox do |v|
  403. v.memory = 1024 + $wmem
  404. end
  405. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid
  406. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("stretch64")
  407. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
  408. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("stretch64")
  409. end
  410. config.vm.define "jessie64" do |b|
  411. b.vm.box = "debian/jessie64"
  412. b.vm.provider :virtualbox do |v|
  413. v.memory = 1024 + $wmem
  414. end
  415. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid
  416. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("jessie64")
  417. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
  418. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("jessie64")
  419. end
  420. config.vm.define "wheezy32" do |b|
  421. b.vm.box = "boxcutter/debian7-i386"
  422. b.vm.provider :virtualbox do |v|
  423. v.memory = 768 + $wmem
  424. end
  425. b.vm.provision "packages prepare wheezy", :type => :shell, :inline => packages_prepare_wheezy
  426. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid
  427. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("wheezy32")
  428. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("wheezy32")
  429. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("wheezy32")
  430. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
  431. b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller()
  432. b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("wheezy32")
  433. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("wheezy32")
  434. end
  435. config.vm.define "wheezy64" do |b|
  436. b.vm.box = "boxcutter/debian7"
  437. b.vm.provider :virtualbox do |v|
  438. v.memory = 1024 + $wmem
  439. end
  440. b.vm.provision "packages prepare wheezy", :type => :shell, :inline => packages_prepare_wheezy
  441. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid
  442. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("wheezy64")
  443. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("wheezy64")
  444. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("wheezy64")
  445. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
  446. b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller()
  447. b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("wheezy64")
  448. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("wheezy64")
  449. end
  450. # OS X
  451. config.vm.define "darwin64" do |b|
  452. b.vm.box = "jhcook/yosemite-clitools"
  453. b.vm.provider :virtualbox do |v|
  454. v.memory = 1536 + $wmem
  455. v.customize ['modifyvm', :id, '--ostype', 'MacOS1010_64']
  456. v.customize ['modifyvm', :id, '--paravirtprovider', 'default']
  457. # Adjust CPU settings according to
  458. # https://github.com/geerlingguy/macos-virtualbox-vm
  459. v.customize ['modifyvm', :id, '--cpuidset',
  460. '00000001', '000306a9', '00020800', '80000201', '178bfbff']
  461. # Disable USB variant requiring Virtualbox proprietary extension pack
  462. v.customize ["modifyvm", :id, '--usbehci', 'off', '--usbxhci', 'off']
  463. end
  464. b.vm.provision "packages darwin", :type => :shell, :privileged => false, :inline => packages_darwin
  465. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("darwin64")
  466. b.vm.provision "fix pyenv", :type => :shell, :privileged => false, :inline => fix_pyenv_darwin("darwin64")
  467. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("darwin64")
  468. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("darwin64")
  469. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
  470. b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller()
  471. b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("darwin64")
  472. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("darwin64")
  473. end
  474. # BSD
  475. # note: the FreeBSD-10.3-RELEASE box needs "vagrant up" twice to start.
  476. config.vm.define "freebsd64" do |b|
  477. b.vm.box = "freebsd/FreeBSD-10.3-RELEASE"
  478. b.vm.provider :virtualbox do |v|
  479. v.memory = 1024 + $wmem
  480. end
  481. b.ssh.shell = "sh"
  482. b.vm.provision "install system packages", :type => :shell, :inline => packages_freebsd
  483. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("freebsd")
  484. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("freebsd")
  485. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("freebsd")
  486. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
  487. b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller()
  488. b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("freebsd")
  489. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("freebsd")
  490. end
  491. config.vm.define "openbsd64" do |b|
  492. b.vm.box = "openbsd60-64" # note: basic openbsd install for vagrant WITH sudo and rsync pre-installed
  493. b.vm.provider :virtualbox do |v|
  494. v.memory = 1024 + $wmem
  495. end
  496. b.ssh.shell = "sh"
  497. b.vm.provision "packages openbsd", :type => :shell, :inline => packages_openbsd
  498. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("openbsd64")
  499. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(false)
  500. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("openbsd64")
  501. end
  502. config.vm.define "netbsd64" do |b|
  503. b.vm.box = "netbsd70-64"
  504. b.vm.provider :virtualbox do |v|
  505. v.memory = 1024 + $wmem
  506. end
  507. b.vm.provision "packages netbsd", :type => :shell, :inline => packages_netbsd
  508. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("netbsd64")
  509. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(false)
  510. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("netbsd64")
  511. end
  512. # rsync on openindiana has troubles, does not set correct owner for /vagrant/borg and thus gives lots of
  513. # permission errors. can be manually fixed in the VM by: sudo chown -R vagrant /vagrant/borg ; then rsync again.
  514. config.vm.define "openindiana64" do |b|
  515. b.vm.box = "openindiana/hipster"
  516. b.vm.provider :virtualbox do |v|
  517. v.memory = 1536 + $wmem
  518. end
  519. b.vm.provision "packages openindiana", :type => :shell, :inline => packages_openindiana
  520. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("openindiana64")
  521. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(false)
  522. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("openindiana64")
  523. end
  524. config.vm.define "windows10" do |b|
  525. b.vm.box = "Microsoft/EdgeOnWindows10"
  526. b.vm.guest = :windows
  527. b.vm.boot_timeout = 180
  528. b.vm.graceful_halt_timeout = 120
  529. b.ssh.shell = "sh -l"
  530. b.ssh.username = "IEUser"
  531. b.ssh.password = "Passw0rd!"
  532. b.ssh.insert_key = false
  533. b.vm.provider :virtualbox do |v|
  534. v.memory = 1536 + $wmem
  535. #v.gui = true
  536. end
  537. # fix permissions placeholder
  538. b.vm.provision "fix perms", :type => :shell, :privileged => false, :inline => "echo 'fix permission placeholder'"
  539. b.vm.provision "packages cygwin", :type => :shell, :privileged => false, :inline => packages_cygwin("x86_64")
  540. b.vm.provision :reload
  541. b.vm.provision "cygwin install pip", :type => :shell, :privileged => false, :inline => install_cygwin_venv
  542. b.vm.provision "cygwin build env", :type => :shell, :privileged => false, :inline => build_sys_venv("windows10")
  543. b.vm.provision "cygwin install borg", :type => :shell, :privileged => false, :inline => install_borg(false)
  544. b.vm.provision "cygwin run tests", :type => :shell, :privileged => false, :inline => run_tests("windows10")
  545. end
  546. end