Vagrantfile 28 KB

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