Vagrantfile 24 KB

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