Vagrantfile 22 KB

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