Vagrantfile 27 KB

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