Vagrantfile 22 KB

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