Vagrantfile 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593
  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.6.3/osxfuse-3.6.3.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.6.3.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/6.1.5/All/"
  134. export PKG_PATH
  135. pkg_add mozilla-rootcerts lz4 git bash
  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 pkg
  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. def packages_openindiana
  155. return <<-EOF
  156. #pkg update # XXX needs separate provisioning step + reboot
  157. pkg install python-34 clang-3.4 lz4 git
  158. python3 -m ensurepip
  159. pip3 install -U setuptools pip wheel virtualenv
  160. touch ~vagrant/.bash_profile ; chown vagrant ~vagrant/.bash_profile
  161. EOF
  162. end
  163. # Install required cygwin packages and configure environment
  164. #
  165. # Microsoft/EdgeOnWindows10 image has MLS-OpenSSH installed by default,
  166. # which is based on cygwin x86_64 but should not be used together with cygwin.
  167. # In order to have have cygwin compatible bash 'ImagePath' is replaced with
  168. # cygrunsrv of newly installed cygwin
  169. #
  170. # supported cygwin versions:
  171. # x86_64
  172. # x86
  173. def packages_cygwin(version)
  174. setup_exe = "setup-#{version}.exe"
  175. return <<-EOF
  176. mkdir -p /cygdrive/c/cygwin
  177. powershell -Command '$client = new-object System.Net.WebClient; $client.DownloadFile("https://www.cygwin.com/#{setup_exe}","C:\\cygwin\\#{setup_exe}")'
  178. echo '
  179. REM --- Change to use different CygWin platform and final install path
  180. set CYGSETUP=#{setup_exe}
  181. REM --- Install build version of CygWin in a subfolder
  182. set OURPATH=%cd%
  183. set CYGBUILD="C:\\cygwin\\CygWin"
  184. set CYGMIRROR=http://mirrors.kernel.org/sourceware/cygwin/
  185. set BASEPKGS=openssh,rsync
  186. set BUILDPKGS=python3,python3-setuptools,python-devel,binutils,gcc-g++,libopenssl,openssl-devel,git,make,liblz4-devel,liblz4_1,curl
  187. %CYGSETUP% -q -B -o -n -R %CYGBUILD% -L -D -s %CYGMIRROR% -P %BASEPKGS%,%BUILDPKGS%
  188. cd /d C:\\cygwin\\CygWin\\bin
  189. regtool set /HKLM/SYSTEM/CurrentControlSet/Services/OpenSSHd/ImagePath "C:\\cygwin\\CygWin\\bin\\cygrunsrv.exe"
  190. bash -c "ssh-host-config --no"
  191. bash -c "chown sshd_server /cygdrive/c/cygwin/CygWin/var/empty"
  192. ' > /cygdrive/c/cygwin/install.bat
  193. echo "alias mkdir='mkdir -p'" > ~/.profile
  194. echo "export CYGWIN_ROOT=/cygdrive/c/cygwin/CygWin" >> ~/.profile
  195. echo 'export PATH=$CYGWIN_ROOT/bin:$PATH' >> ~/.profile
  196. echo '' > ~/.bash_profile
  197. cmd.exe /c 'setx /m PATH "C:\\cygwin\\CygWin\\bin;%PATH%"'
  198. source ~/.profile
  199. cd /cygdrive/c/cygwin && cmd.exe /c install.bat
  200. echo 'db_home: windows' > $CYGWIN_ROOT/etc/nsswitch.conf
  201. EOF
  202. end
  203. def install_cygwin_venv
  204. return <<-EOF
  205. python3 -m ensurepip -U --default-pip
  206. pip install virtualenv
  207. EOF
  208. end
  209. def install_pyenv(boxname)
  210. script = <<-EOF
  211. curl -s -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash
  212. echo 'export PATH="$HOME/.pyenv/bin:/vagrant/borg:$PATH"' >> ~/.bash_profile
  213. echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
  214. echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bash_profile
  215. echo 'export PYTHON_CONFIGURE_OPTS="--enable-shared"' >> ~/.bash_profile
  216. echo 'export LANG=en_US.UTF-8' >> ~/.bash_profile
  217. EOF
  218. script += "echo 'export XDISTN=%d' >> ~/.bash_profile\n" % [$xdistn]
  219. return script
  220. end
  221. def fix_pyenv_darwin(boxname)
  222. return <<-EOF
  223. echo 'export PYTHON_CONFIGURE_OPTS="--enable-framework"' >> ~/.bash_profile
  224. EOF
  225. end
  226. def install_pythons(boxname)
  227. return <<-EOF
  228. . ~/.bash_profile
  229. pyenv install 3.4.0 # tests
  230. pyenv install 3.5.0 # tests
  231. pyenv install 3.6.0 # tests
  232. pyenv install 3.5.3 # binary build, use latest 3.5.x release
  233. pyenv rehash
  234. EOF
  235. end
  236. def build_sys_venv(boxname)
  237. return <<-EOF
  238. . ~/.bash_profile
  239. cd /vagrant/borg
  240. virtualenv --python=python3 borg-env
  241. EOF
  242. end
  243. def build_pyenv_venv(boxname)
  244. return <<-EOF
  245. . ~/.bash_profile
  246. cd /vagrant/borg
  247. # use the latest 3.5 release
  248. pyenv global 3.5.3
  249. pyenv virtualenv 3.5.3 borg-env
  250. ln -s ~/.pyenv/versions/borg-env .
  251. EOF
  252. end
  253. def install_borg(fuse)
  254. script = <<-EOF
  255. . ~/.bash_profile
  256. cd /vagrant/borg
  257. . borg-env/bin/activate
  258. pip install -U wheel # upgrade wheel, too old for 3.5
  259. cd borg
  260. # clean up (wrong/outdated) stuff we likely got via rsync:
  261. rm -rf __pycache__
  262. find src -name '__pycache__' -exec rm -rf {} \\;
  263. pip install -r requirements.d/development.txt
  264. python setup.py clean
  265. EOF
  266. if fuse
  267. script += <<-EOF
  268. # by using [fuse], setup.py can handle different FUSE requirements:
  269. pip install -e .[fuse]
  270. EOF
  271. else
  272. script += <<-EOF
  273. pip install -e .
  274. # do not install llfuse into the virtualenvs built by tox:
  275. sed -i.bak '/fuse.txt/d' tox.ini
  276. EOF
  277. end
  278. return script
  279. end
  280. def install_pyinstaller()
  281. return <<-EOF
  282. . ~/.bash_profile
  283. cd /vagrant/borg
  284. . borg-env/bin/activate
  285. git clone https://github.com/thomaswaldmann/pyinstaller.git
  286. cd pyinstaller
  287. git checkout v3.2.1
  288. python setup.py install
  289. EOF
  290. end
  291. def build_binary_with_pyinstaller(boxname)
  292. return <<-EOF
  293. . ~/.bash_profile
  294. cd /vagrant/borg
  295. . borg-env/bin/activate
  296. cd borg
  297. pyinstaller --clean --distpath=/vagrant/borg scripts/borg.exe.spec
  298. EOF
  299. end
  300. def run_tests(boxname)
  301. return <<-EOF
  302. . ~/.bash_profile
  303. cd /vagrant/borg/borg
  304. . ../borg-env/bin/activate
  305. if which pyenv 2> /dev/null; then
  306. # for testing, use the earliest point releases of the supported python versions:
  307. pyenv global 3.4.0 3.5.0 3.6.0
  308. pyenv local 3.4.0 3.5.0 3.6.0
  309. fi
  310. # otherwise: just use the system python
  311. if which fakeroot 2> /dev/null; then
  312. echo "Running tox WITH fakeroot -u"
  313. fakeroot -u tox --skip-missing-interpreters
  314. else
  315. echo "Running tox WITHOUT fakeroot -u"
  316. tox --skip-missing-interpreters
  317. fi
  318. EOF
  319. end
  320. def fix_perms
  321. return <<-EOF
  322. # . ~/.profile
  323. if id "vagrant" >/dev/null 2>&1; then
  324. chown -R vagrant /vagrant/borg
  325. else
  326. chown -R ubuntu /vagrant/borg
  327. fi
  328. EOF
  329. end
  330. Vagrant.configure(2) do |config|
  331. # use rsync to copy content to the folder
  332. config.vm.synced_folder ".", "/vagrant/borg/borg", :type => "rsync", :rsync__args => ["--verbose", "--archive", "--delete", "-z"], :rsync__chown => false
  333. # do not let the VM access . on the host machine via the default shared folder!
  334. config.vm.synced_folder ".", "/vagrant", disabled: true
  335. # fix permissions on synced folder
  336. config.vm.provision "fix perms", :type => :shell, :inline => fix_perms
  337. config.vm.provider :virtualbox do |v|
  338. #v.gui = true
  339. v.cpus = $cpus
  340. end
  341. # Linux
  342. config.vm.define "centos7_64" do |b|
  343. b.vm.box = "centos/7"
  344. b.vm.provider :virtualbox do |v|
  345. v.memory = 1024 + $wmem
  346. end
  347. b.vm.provision "install system packages", :type => :shell, :inline => packages_redhatted
  348. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("centos7_64")
  349. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("centos7_64")
  350. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("centos7_64")
  351. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
  352. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("centos7_64")
  353. end
  354. config.vm.define "centos6_32" do |b|
  355. b.vm.box = "centos6-32"
  356. b.vm.provider :virtualbox do |v|
  357. v.memory = 768 + $wmem
  358. end
  359. b.vm.provision "install system packages", :type => :shell, :inline => packages_redhatted
  360. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("centos6_32")
  361. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("centos6_32")
  362. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("centos6_32")
  363. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(false)
  364. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("centos6_32")
  365. end
  366. config.vm.define "centos6_64" do |b|
  367. b.vm.box = "centos6-64"
  368. b.vm.provider :virtualbox do |v|
  369. v.memory = 1024 + $wmem
  370. end
  371. b.vm.provision "install system packages", :type => :shell, :inline => packages_redhatted
  372. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("centos6_64")
  373. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("centos6_64")
  374. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("centos6_64")
  375. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(false)
  376. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("centos6_64")
  377. end
  378. config.vm.define "xenial64" do |b|
  379. b.vm.box = "ubuntu/xenial64"
  380. b.vm.provider :virtualbox do |v|
  381. v.memory = 1024 + $wmem
  382. end
  383. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid
  384. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("xenial64")
  385. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
  386. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("xenial64")
  387. end
  388. config.vm.define "trusty64" do |b|
  389. b.vm.box = "ubuntu/trusty64"
  390. b.vm.provider :virtualbox do |v|
  391. v.memory = 1024 + $wmem
  392. end
  393. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid
  394. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("trusty64")
  395. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
  396. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("trusty64")
  397. end
  398. config.vm.define "stretch64" do |b|
  399. b.vm.box = "debian/stretch64"
  400. b.vm.provider :virtualbox do |v|
  401. v.memory = 1024 + $wmem
  402. end
  403. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid
  404. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("stretch64")
  405. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
  406. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("stretch64")
  407. end
  408. config.vm.define "jessie64" do |b|
  409. b.vm.box = "debian/jessie64"
  410. b.vm.provider :virtualbox do |v|
  411. v.memory = 1024 + $wmem
  412. end
  413. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid
  414. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("jessie64")
  415. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
  416. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("jessie64")
  417. end
  418. config.vm.define "wheezy32" do |b|
  419. b.vm.box = "boxcutter/debian7-i386"
  420. b.vm.provider :virtualbox do |v|
  421. v.memory = 768 + $wmem
  422. end
  423. b.vm.provision "packages prepare wheezy", :type => :shell, :inline => packages_prepare_wheezy
  424. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid
  425. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("wheezy32")
  426. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("wheezy32")
  427. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("wheezy32")
  428. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
  429. b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller()
  430. b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("wheezy32")
  431. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("wheezy32")
  432. end
  433. config.vm.define "wheezy64" do |b|
  434. b.vm.box = "boxcutter/debian7"
  435. b.vm.provider :virtualbox do |v|
  436. v.memory = 1024 + $wmem
  437. end
  438. b.vm.provision "packages prepare wheezy", :type => :shell, :inline => packages_prepare_wheezy
  439. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid
  440. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("wheezy64")
  441. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("wheezy64")
  442. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("wheezy64")
  443. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
  444. b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller()
  445. b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("wheezy64")
  446. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("wheezy64")
  447. end
  448. # OS X
  449. config.vm.define "darwin64" do |b|
  450. b.vm.box = "jhcook/yosemite-clitools"
  451. b.vm.provider :virtualbox do |v|
  452. v.memory = 1536 + $wmem
  453. v.customize ['modifyvm', :id, '--ostype', 'MacOS1010_64']
  454. v.customize ['modifyvm', :id, '--paravirtprovider', 'default']
  455. # Adjust CPU settings according to
  456. # https://github.com/geerlingguy/macos-virtualbox-vm
  457. v.customize ['modifyvm', :id, '--cpuidset',
  458. '00000001', '000306a9', '00020800', '80000201', '178bfbff']
  459. # Disable USB variant requiring Virtualbox proprietary extension pack
  460. v.customize ["modifyvm", :id, '--usbehci', 'off', '--usbxhci', 'off']
  461. end
  462. b.vm.provision "packages darwin", :type => :shell, :privileged => false, :inline => packages_darwin
  463. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("darwin64")
  464. b.vm.provision "fix pyenv", :type => :shell, :privileged => false, :inline => fix_pyenv_darwin("darwin64")
  465. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("darwin64")
  466. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("darwin64")
  467. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
  468. b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller()
  469. b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("darwin64")
  470. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("darwin64")
  471. end
  472. # BSD
  473. # note: the FreeBSD-10.3-RELEASE box needs "vagrant up" twice to start.
  474. config.vm.define "freebsd64" do |b|
  475. b.vm.box = "freebsd/FreeBSD-10.3-RELEASE"
  476. b.vm.provider :virtualbox do |v|
  477. v.memory = 1024 + $wmem
  478. end
  479. b.ssh.shell = "sh"
  480. b.vm.provision "install system packages", :type => :shell, :inline => packages_freebsd
  481. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("freebsd")
  482. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("freebsd")
  483. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("freebsd")
  484. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
  485. b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller()
  486. b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("freebsd")
  487. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("freebsd")
  488. end
  489. config.vm.define "openbsd64" do |b|
  490. b.vm.box = "openbsd60-64" # note: basic openbsd install for vagrant WITH sudo and rsync pre-installed
  491. b.vm.provider :virtualbox do |v|
  492. v.memory = 1024 + $wmem
  493. end
  494. b.ssh.shell = "sh"
  495. b.vm.provision "packages openbsd", :type => :shell, :inline => packages_openbsd
  496. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("openbsd64")
  497. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(false)
  498. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("openbsd64")
  499. end
  500. config.vm.define "netbsd64" do |b|
  501. b.vm.box = "netbsd70-64"
  502. b.vm.provider :virtualbox do |v|
  503. v.memory = 1024 + $wmem
  504. end
  505. b.vm.provision "packages netbsd", :type => :shell, :inline => packages_netbsd
  506. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("netbsd64")
  507. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(false)
  508. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("netbsd64")
  509. end
  510. # rsync on openindiana has troubles, does not set correct owner for /vagrant/borg and thus gives lots of
  511. # permission errors. can be manually fixed in the VM by: sudo chown -R vagrant /vagrant/borg ; then rsync again.
  512. config.vm.define "openindiana64" do |b|
  513. b.vm.box = "openindiana/hipster"
  514. b.vm.provider :virtualbox do |v|
  515. v.memory = 1536 + $wmem
  516. end
  517. b.vm.provision "packages openindiana", :type => :shell, :inline => packages_openindiana
  518. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("openindiana64")
  519. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(false)
  520. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("openindiana64")
  521. end
  522. config.vm.define "windows10" do |b|
  523. b.vm.box = "Microsoft/EdgeOnWindows10"
  524. b.vm.guest = :windows
  525. b.vm.boot_timeout = 180
  526. b.vm.graceful_halt_timeout = 120
  527. b.ssh.shell = "sh -l"
  528. b.ssh.username = "IEUser"
  529. b.ssh.password = "Passw0rd!"
  530. b.ssh.insert_key = false
  531. b.vm.provider :virtualbox do |v|
  532. v.memory = 1536 + $wmem
  533. #v.gui = true
  534. end
  535. # fix permissions placeholder
  536. b.vm.provision "fix perms", :type => :shell, :privileged => false, :inline => "echo 'fix permission placeholder'"
  537. b.vm.provision "packages cygwin", :type => :shell, :privileged => false, :inline => packages_cygwin("x86_64")
  538. b.vm.provision :reload
  539. b.vm.provision "cygwin install pip", :type => :shell, :privileged => false, :inline => install_cygwin_venv
  540. b.vm.provision "cygwin build env", :type => :shell, :privileged => false, :inline => build_sys_venv("windows10")
  541. b.vm.provision "cygwin install borg", :type => :shell, :privileged => false, :inline => install_borg(false)
  542. b.vm.provision "cygwin run tests", :type => :shell, :privileged => false, :inline => run_tests("windows10")
  543. end
  544. end