Vagrantfile 23 KB

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