Vagrantfile 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537
  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
  56. brew install --cask macfuse
  57. # brew upgrade # upgrade everything (takes rather long)
  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. EOF
  99. end
  100. def packages_netbsd
  101. return <<-EOF
  102. # use the latest stuff, some packages in "9.2" are quite broken
  103. echo 'http://ftp.NetBSD.org/pub/pkgsrc/packages/NetBSD/$arch/9.0_current/All' > /usr/pkg/etc/pkgin/repositories.conf
  104. pkgin update
  105. pkgin -y upgrade
  106. pkg_add zstd lz4 xxhash git
  107. pkg_add bash
  108. chsh -s bash vagrant
  109. echo "export PROMPT_COMMAND=" >> ~vagrant/.bash_profile # bug in netbsd 9.2, .bash_profile broken for screen
  110. echo "export PROMPT_COMMAND=" >> ~root/.bash_profile # bug in netbsd 9.2, .bash_profile broken for screen
  111. pkg_add pkg-config
  112. # pkg_add fuse # llfuse supports netbsd, but is still buggy.
  113. # https://bitbucket.org/nikratio/python-llfuse/issues/70/perfuse_open-setsockopt-no-buffer-space
  114. pkg_add python38 py38-sqlite3 py38-pip py38-virtualenv py38-expat
  115. ln -s /usr/pkg/lib/python3.8/_sysconfigdata_netbsd9.py /usr/pkg/lib/python3.8/_sysconfigdata__netbsd9_.py # bug in netbsd 9.2, expected filename not there.
  116. pkg_add python39 py39-sqlite3 py39-pip py39-virtualenv py39-expat
  117. ln -s /usr/pkg/bin/python3.9 /usr/pkg/bin/python
  118. ln -s /usr/pkg/bin/python3.9 /usr/pkg/bin/python3
  119. ln -s /usr/pkg/bin/pip3.9 /usr/pkg/bin/pip
  120. ln -s /usr/pkg/bin/pip3.9 /usr/pkg/bin/pip3
  121. ln -s /usr/pkg/bin/virtualenv-3.9 /usr/pkg/bin/virtualenv
  122. ln -s /usr/pkg/bin/virtualenv-3.9 /usr/pkg/bin/virtualenv3
  123. ln -s /usr/pkg/lib/python3.9/_sysconfigdata_netbsd9.py /usr/pkg/lib/python3.9/_sysconfigdata__netbsd9_.py # bug in netbsd 9.2, expected filename not there.
  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. return <<-EOF
  186. echo 'export PYTHON_CONFIGURE_OPTS="--enable-shared"' >> ~/.bash_profile
  187. echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
  188. echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
  189. . ~/.bash_profile
  190. curl -s -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash
  191. echo 'eval "$(pyenv init --path)"' >> ~/.bash_profile
  192. echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
  193. echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
  194. echo 'eval "$(pyenv init -)"' >> ~/.bashrc
  195. echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc
  196. EOF
  197. end
  198. def fix_pyenv_darwin(boxname)
  199. return <<-EOF
  200. echo 'export PYTHON_CONFIGURE_OPTS="--enable-framework"' >> ~/.bash_profile
  201. EOF
  202. end
  203. def install_pythons(boxname)
  204. return <<-EOF
  205. . ~/.bash_profile
  206. pyenv install 3.5.3 # tests, 3.5.3 is first to support openssl 1.1
  207. pyenv install 3.6.2 # tests
  208. pyenv install 3.7.12 # binary build, use latest 3.7.x release
  209. pyenv install 3.8.0 # tests
  210. pyenv install 3.9.0 # tests
  211. pyenv install 3.10.0 # tests
  212. pyenv rehash
  213. EOF
  214. end
  215. def build_sys_venv(boxname)
  216. return <<-EOF
  217. . ~/.bash_profile
  218. cd /vagrant/borg
  219. virtualenv --python=python3 borg-env
  220. EOF
  221. end
  222. def build_pyenv_venv(boxname)
  223. return <<-EOF
  224. . ~/.bash_profile
  225. cd /vagrant/borg
  226. # use the latest 3.7 release
  227. pyenv global 3.7.12
  228. pyenv virtualenv 3.7.12 borg-env
  229. ln -s ~/.pyenv/versions/borg-env .
  230. EOF
  231. end
  232. def install_borg(fuse)
  233. script = <<-EOF
  234. . ~/.bash_profile
  235. cd /vagrant/borg
  236. . borg-env/bin/activate
  237. pip install -U wheel # upgrade wheel, too old for 3.5
  238. cd borg
  239. pip install -r requirements.d/development.lock.txt
  240. python setup.py clean
  241. python setup.py clean2
  242. EOF
  243. if fuse
  244. script += <<-EOF
  245. # by using [fuse], setup.py can handle different FUSE requirements:
  246. pip install -e .[fuse]
  247. EOF
  248. else
  249. script += <<-EOF
  250. pip install -e .
  251. # do not install llfuse into the virtualenvs built by tox:
  252. sed -i.bak '/fuse.txt/d' tox.ini
  253. EOF
  254. end
  255. return script
  256. end
  257. def install_pyinstaller()
  258. return <<-EOF
  259. . ~/.bash_profile
  260. cd /vagrant/borg
  261. . borg-env/bin/activate
  262. git clone https://github.com/thomaswaldmann/pyinstaller.git
  263. cd pyinstaller
  264. git checkout v4.2-maint
  265. python setup.py install
  266. EOF
  267. end
  268. def build_binary_with_pyinstaller(boxname)
  269. return <<-EOF
  270. . ~/.bash_profile
  271. cd /vagrant/borg
  272. . borg-env/bin/activate
  273. cd borg
  274. pyinstaller --clean --distpath=/vagrant/borg scripts/borg.exe.spec
  275. echo 'export PATH="/vagrant/borg:$PATH"' >> ~/.bash_profile
  276. cd .. && tar -czvf borg.tgz borg-dir
  277. EOF
  278. end
  279. def run_tests(boxname)
  280. return <<-EOF
  281. . ~/.bash_profile
  282. cd /vagrant/borg/borg
  283. . ../borg-env/bin/activate
  284. if which pyenv 2> /dev/null; then
  285. # for testing, use the earliest point releases of the supported python versions.
  286. # on some dists, 3.10 does not compile, so if pyenv fails due to this, try without 3.10.
  287. pyenv global 3.5.3 3.6.2 3.7.12 3.8.0 3.9.0 3.10.0 || pyenv global 3.5.3 3.6.2 3.7.12 3.8.0 3.9.0
  288. pyenv local 3.5.3 3.6.2 3.7.12 3.8.0 3.9.0 3.10.0 || pyenv local 3.5.3 3.6.2 3.7.12 3.8.0 3.9.0
  289. fi
  290. # otherwise: just use the system python
  291. if which fakeroot 2> /dev/null; then
  292. echo "Running tox WITH fakeroot -u"
  293. fakeroot -u tox --skip-missing-interpreters -e py35,py36,py37,py38,py39,py310
  294. else
  295. echo "Running tox WITHOUT fakeroot -u"
  296. tox --skip-missing-interpreters -e py35,py36,py37,py38,py39,py310
  297. fi
  298. EOF
  299. end
  300. def fs_init(user)
  301. return <<-EOF
  302. # clean up (wrong/outdated) stuff we likely got via rsync:
  303. rm -rf /vagrant/borg/borg/.tox 2> /dev/null
  304. rm -rf /vagrant/borg/borg/borgbackup.egg-info 2> /dev/null
  305. rm -rf /vagrant/borg/borg/__pycache__ 2> /dev/null
  306. find /vagrant/borg/borg/src -name '__pycache__' -exec rm -rf {} \\; 2> /dev/null
  307. chown -R #{user} /vagrant/borg
  308. touch ~#{user}/.bash_profile ; chown #{user} ~#{user}/.bash_profile
  309. echo 'export LANG=en_US.UTF-8' >> ~#{user}/.bash_profile
  310. echo 'export LC_CTYPE=en_US.UTF-8' >> ~#{user}/.bash_profile
  311. echo 'export XDISTN=#{$xdistn}' >> ~#{user}/.bash_profile
  312. EOF
  313. end
  314. Vagrant.configure(2) do |config|
  315. # use rsync to copy content to the folder
  316. config.vm.synced_folder ".", "/vagrant/borg/borg", :type => "rsync", :rsync__args => ["--verbose", "--archive", "--delete", "-z"], :rsync__chown => false
  317. # do not let the VM access . on the host machine via the default shared folder!
  318. config.vm.synced_folder ".", "/vagrant", disabled: true
  319. config.vm.provider :virtualbox do |v|
  320. #v.gui = true
  321. v.cpus = $cpus
  322. end
  323. # Linux
  324. config.vm.define "centos7_64" do |b|
  325. b.vm.box = "centos/7"
  326. b.vm.provider :virtualbox do |v|
  327. v.memory = 1024 + $wmem
  328. end
  329. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  330. b.vm.provision "install system packages", :type => :shell, :inline => packages_redhatted
  331. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("centos7_64")
  332. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("centos7_64")
  333. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("centos7_64")
  334. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
  335. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("centos7_64")
  336. end
  337. config.vm.define "jammy64" do |b|
  338. b.vm.box = "ubuntu/jammy64"
  339. b.vm.provider :virtualbox do |v|
  340. v.memory = 1024 + $wmem
  341. end
  342. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  343. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid("vagrant")
  344. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("jammy64")
  345. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
  346. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("jammy64")
  347. end
  348. config.vm.define "focal64" do |b|
  349. b.vm.box = "ubuntu/focal64"
  350. b.vm.provider :virtualbox do |v|
  351. v.memory = 1024 + $wmem
  352. end
  353. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  354. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid("vagrant")
  355. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("focal64")
  356. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
  357. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("focal64")
  358. end
  359. config.vm.define "bionic64" do |b|
  360. b.vm.box = "ubuntu/bionic64"
  361. b.vm.provider :virtualbox do |v|
  362. v.memory = 1024 + $wmem
  363. end
  364. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  365. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid("vagrant")
  366. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("bionic64")
  367. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
  368. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("bionic64")
  369. end
  370. config.vm.define "buster64" do |b|
  371. b.vm.box = "debian/buster64"
  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("buster64")
  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("buster64")
  380. end
  381. config.vm.define "stretch64" do |b|
  382. b.vm.box = "debian/stretch64"
  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 "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("stretch64")
  389. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("stretch64")
  390. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("stretch64")
  391. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
  392. b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller()
  393. b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("stretch64")
  394. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("stretch64")
  395. end
  396. # OS X
  397. config.vm.define "darwin64" do |b|
  398. b.vm.box = "macos-sierra"
  399. b.vm.provider :virtualbox do |v|
  400. v.memory = 4096 + $wmem
  401. v.customize ['modifyvm', :id, '--ostype', 'MacOS_64']
  402. v.customize ['modifyvm', :id, '--paravirtprovider', 'default']
  403. v.customize ['modifyvm', :id, '--nested-hw-virt', 'on']
  404. # Adjust CPU settings according to
  405. # https://github.com/geerlingguy/macos-virtualbox-vm
  406. v.customize ['modifyvm', :id, '--cpuidset',
  407. '00000001', '000306a9', '00020800', '80000201', '178bfbff']
  408. # Disable USB variant requiring Virtualbox proprietary extension pack
  409. v.customize ["modifyvm", :id, '--usbehci', 'off', '--usbxhci', 'off']
  410. end
  411. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  412. b.vm.provision "packages darwin", :type => :shell, :privileged => false, :inline => packages_darwin
  413. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("darwin64")
  414. b.vm.provision "fix pyenv", :type => :shell, :privileged => false, :inline => fix_pyenv_darwin("darwin64")
  415. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("darwin64")
  416. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("darwin64")
  417. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
  418. b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller()
  419. b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("darwin64")
  420. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("darwin64")
  421. end
  422. # BSD
  423. config.vm.define "freebsd64" do |b|
  424. b.vm.box = "freebsd121-64"
  425. b.vm.provider :virtualbox do |v|
  426. v.memory = 1024 + $wmem
  427. end
  428. b.ssh.shell = "sh"
  429. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  430. b.vm.provision "install system packages", :type => :shell, :inline => packages_freebsd
  431. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("freebsd")
  432. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("freebsd")
  433. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("freebsd")
  434. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
  435. b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller()
  436. b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("freebsd")
  437. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("freebsd")
  438. end
  439. config.vm.define "openbsd64" do |b|
  440. b.vm.box = "generic/openbsd6"
  441. b.vm.provider :virtualbox do |v|
  442. v.memory = 1024 + $wmem
  443. end
  444. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  445. b.vm.provision "packages openbsd", :type => :shell, :inline => packages_openbsd
  446. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("openbsd64")
  447. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(false)
  448. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("openbsd64")
  449. end
  450. config.vm.define "netbsd64" do |b|
  451. b.vm.box = "generic/netbsd9"
  452. b.vm.provider :virtualbox do |v|
  453. v.memory = 4096 + $wmem # need big /tmp tmpfs in RAM!
  454. end
  455. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  456. b.vm.provision "packages netbsd", :type => :shell, :inline => packages_netbsd
  457. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("netbsd64")
  458. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(false)
  459. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("netbsd64")
  460. end
  461. # rsync on openindiana has troubles, does not set correct owner for /vagrant/borg and thus gives lots of
  462. # permission errors. can be manually fixed in the VM by: sudo chown -R vagrant /vagrant/borg ; then rsync again.
  463. config.vm.define "openindiana64" do |b|
  464. b.vm.box = "openindiana"
  465. b.vm.provider :virtualbox do |v|
  466. v.memory = 2048 + $wmem
  467. end
  468. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  469. b.vm.provision "packages openindiana", :type => :shell, :inline => packages_openindiana
  470. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("openindiana64")
  471. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(false)
  472. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("openindiana64")
  473. end
  474. config.vm.define "windows10" do |b|
  475. b.vm.box = "Microsoft/EdgeOnWindows10"
  476. b.vm.guest = :windows
  477. b.vm.boot_timeout = 180
  478. b.vm.graceful_halt_timeout = 120
  479. b.ssh.shell = "sh -l"
  480. b.ssh.username = "IEUser"
  481. b.ssh.password = "Passw0rd!"
  482. b.ssh.insert_key = false
  483. b.vm.provider :virtualbox do |v|
  484. v.memory = 1536 + $wmem
  485. #v.gui = true
  486. end
  487. b.vm.provision "packages cygwin", :type => :shell, :privileged => false, :inline => packages_cygwin("x86_64")
  488. b.vm.provision :reload
  489. b.vm.provision "cygwin install pip", :type => :shell, :privileged => false, :inline => install_cygwin_venv
  490. b.vm.provision "cygwin build env", :type => :shell, :privileged => false, :inline => build_sys_venv("windows10")
  491. b.vm.provision "cygwin install borg", :type => :shell, :privileged => false, :inline => install_borg(false)
  492. b.vm.provision "cygwin run tests", :type => :shell, :privileged => false, :inline => run_tests("windows10")
  493. end
  494. end