Vagrantfile 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548
  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 --install --all
  62. # get osxfuse 3.x release code from github:
  63. curl -s -L https://github.com/osxfuse/osxfuse/releases/download/osxfuse-3.5.2/osxfuse-3.5.2.dmg >osxfuse.dmg
  64. MOUNTDIR=$(echo `hdiutil mount osxfuse.dmg | tail -1 | awk '{$1="" ; print $0}'` | xargs -0 echo) \
  65. && sudo installer -pkg "${MOUNTDIR}/Extras/FUSE for macOS 3.5.2.pkg" -target /
  66. sudo chown -R vagrant /usr/local # brew must be able to create stuff here
  67. ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  68. brew update
  69. brew install openssl
  70. brew install lz4
  71. brew install xz # required for python lzma module
  72. brew install fakeroot
  73. brew install git
  74. brew install pkg-config
  75. touch ~vagrant/.bash_profile ; chown vagrant ~vagrant/.bash_profile
  76. EOF
  77. end
  78. def packages_freebsd
  79. return <<-EOF
  80. # install all the (security and other) updates, base system
  81. freebsd-update --not-running-from-cron fetch install
  82. # for building borgbackup and dependencies:
  83. pkg install -y openssl liblz4 fusefs-libs pkgconf
  84. pkg install -y fakeroot git bash
  85. # for building python:
  86. pkg install -y sqlite3
  87. # make bash default / work:
  88. chsh -s bash vagrant
  89. mount -t fdescfs fdesc /dev/fd
  90. echo 'fdesc /dev/fd fdescfs rw 0 0' >> /etc/fstab
  91. # make FUSE work
  92. echo 'fuse_load="YES"' >> /boot/loader.conf
  93. echo 'vfs.usermount=1' >> /etc/sysctl.conf
  94. kldload fuse
  95. sysctl vfs.usermount=1
  96. pw groupmod operator -M vagrant
  97. # /dev/fuse has group operator
  98. chmod 666 /dev/fuse
  99. touch ~vagrant/.bash_profile ; chown vagrant ~vagrant/.bash_profile
  100. # install all the (security and other) updates, packages
  101. pkg update
  102. yes | pkg upgrade
  103. EOF
  104. end
  105. def packages_openbsd
  106. return <<-EOF
  107. . ~/.profile
  108. pkg_add bash
  109. chsh -s /usr/local/bin/bash vagrant
  110. pkg_add openssl
  111. pkg_add lz4
  112. pkg_add git # no fakeroot
  113. pkg_add py3-setuptools
  114. ln -sf /usr/local/bin/python3.4 /usr/local/bin/python3
  115. ln -sf /usr/local/bin/python3.4 /usr/local/bin/python
  116. easy_install-3.4 pip
  117. pip3 install virtualenv
  118. touch ~vagrant/.bash_profile ; chown vagrant ~vagrant/.bash_profile
  119. EOF
  120. end
  121. def packages_netbsd
  122. return <<-EOF
  123. hostname netbsd # the box we use has an invalid hostname
  124. PKG_PATH="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/NetBSD/amd64/6.1.5/All/"
  125. export PKG_PATH
  126. pkg_add mozilla-rootcerts lz4 git bash
  127. chsh -s bash vagrant
  128. mkdir -p /usr/local/opt/lz4/include
  129. mkdir -p /usr/local/opt/lz4/lib
  130. ln -s /usr/pkg/include/lz4*.h /usr/local/opt/lz4/include/
  131. ln -s /usr/pkg/lib/liblz4* /usr/local/opt/lz4/lib/
  132. touch /etc/openssl/openssl.cnf # avoids a flood of "can't open ..."
  133. mozilla-rootcerts install
  134. pkg_add pkg-config # avoids some "pkg-config missing" error msg, even without fuse
  135. # pkg_add fuse # llfuse supports netbsd, but is still buggy.
  136. # https://bitbucket.org/nikratio/python-llfuse/issues/70/perfuse_open-setsockopt-no-buffer-space
  137. pkg_add python34 py34-setuptools
  138. ln -s /usr/pkg/bin/python3.4 /usr/pkg/bin/python
  139. ln -s /usr/pkg/bin/python3.4 /usr/pkg/bin/python3
  140. easy_install-3.4 pip
  141. pip install virtualenv
  142. touch ~vagrant/.bash_profile ; chown vagrant ~vagrant/.bash_profile
  143. EOF
  144. end
  145. # Install required cygwin packages and configure environment
  146. #
  147. # Microsoft/EdgeOnWindows10 image has MLS-OpenSSH installed by default,
  148. # which is based on cygwin x86_64 but should not be used together with cygwin.
  149. # In order to have have cygwin compatible bash 'ImagePath' is replaced with
  150. # cygrunsrv of newly installed cygwin
  151. #
  152. # supported cygwin versions:
  153. # x86_64
  154. # x86
  155. def packages_cygwin(version)
  156. setup_exe = "setup-#{version}.exe"
  157. return <<-EOF
  158. mkdir -p /cygdrive/c/cygwin
  159. powershell -Command '$client = new-object System.Net.WebClient; $client.DownloadFile("https://www.cygwin.com/#{setup_exe}","C:\\cygwin\\#{setup_exe}")'
  160. echo '
  161. REM --- Change to use different CygWin platform and final install path
  162. set CYGSETUP=#{setup_exe}
  163. REM --- Install build version of CygWin in a subfolder
  164. set OURPATH=%cd%
  165. set CYGBUILD="C:\\cygwin\\CygWin"
  166. set CYGMIRROR=ftp://mirrors.kernel.org/sourceware/cygwin/
  167. set BUILDPKGS=python3,python3-setuptools,binutils,gcc-g++,libopenssl,openssl-devel,git,make,openssh,liblz4-devel,liblz4_1,rsync,curl,python-devel
  168. %CYGSETUP% -q -B -o -n -R %CYGBUILD% -L -D -s %CYGMIRROR% -P %BUILDPKGS%
  169. cd /d C:\\cygwin\\CygWin\\bin
  170. regtool set /HKLM/SYSTEM/CurrentControlSet/Services/OpenSSHd/ImagePath "C:\\cygwin\\CygWin\\bin\\cygrunsrv.exe"
  171. bash -c "ssh-host-config --no"
  172. ' > /cygdrive/c/cygwin/install.bat
  173. cd /cygdrive/c/cygwin && cmd.exe /c install.bat
  174. echo "alias mkdir='mkdir -p'" > ~/.profile
  175. echo "export CYGWIN_ROOT=/cygdrive/c/cygwin/CygWin" >> ~/.profile
  176. echo 'export PATH=$PATH:$CYGWIN_ROOT/bin' >> ~/.profile
  177. echo '' > ~/.bash_profile
  178. cmd.exe /c 'setx /m PATH "%PATH%;C:\\cygwin\\CygWin\\bin"'
  179. source ~/.profile
  180. echo 'db_home: windows' > $CYGWIN_ROOT/etc/nsswitch.conf
  181. EOF
  182. end
  183. def install_cygwin_venv
  184. return <<-EOF
  185. easy_install-3.4 pip
  186. pip install virtualenv
  187. EOF
  188. end
  189. def install_pyenv(boxname)
  190. return <<-EOF
  191. curl -s -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash
  192. echo 'export PATH="$HOME/.pyenv/bin:/vagrant/borg:$PATH"' >> ~/.bash_profile
  193. echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
  194. echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bash_profile
  195. echo 'export PYTHON_CONFIGURE_OPTS="--enable-shared"' >> ~/.bash_profile
  196. echo 'export LANG=en_US.UTF-8' >> ~/.bash_profile
  197. EOF
  198. end
  199. def fix_pyenv_darwin(boxname)
  200. return <<-EOF
  201. echo 'export PYTHON_CONFIGURE_OPTS="--enable-framework"' >> ~/.bash_profile
  202. EOF
  203. end
  204. def install_pythons(boxname)
  205. return <<-EOF
  206. . ~/.bash_profile
  207. pyenv install 3.4.0 # tests
  208. pyenv install 3.5.0 # tests
  209. pyenv install 3.5.2 # binary build, use latest 3.5.x release
  210. pyenv rehash
  211. EOF
  212. end
  213. def build_sys_venv(boxname)
  214. return <<-EOF
  215. . ~/.bash_profile
  216. cd /vagrant/borg
  217. virtualenv --python=python3 borg-env
  218. EOF
  219. end
  220. def build_pyenv_venv(boxname)
  221. return <<-EOF
  222. . ~/.bash_profile
  223. cd /vagrant/borg
  224. # use the latest 3.5 release
  225. pyenv global 3.5.2
  226. pyenv virtualenv 3.5.2 borg-env
  227. ln -s ~/.pyenv/versions/borg-env .
  228. EOF
  229. end
  230. def install_borg(boxname)
  231. return <<-EOF
  232. . ~/.bash_profile
  233. cd /vagrant/borg
  234. . borg-env/bin/activate
  235. pip install -U wheel # upgrade wheel, too old for 3.5
  236. cd borg
  237. # clean up (wrong/outdated) stuff we likely got via rsync:
  238. rm -f borg/*.so borg/*.cpy*
  239. rm -f borg/{chunker,crypto,compress,hashindex,platform_linux}.c
  240. rm -rf borg/__pycache__ borg/support/__pycache__ borg/testsuite/__pycache__
  241. pip install -r requirements.d/development.txt
  242. # by using [fuse], setup.py can handle different fuse requirements:
  243. pip install -e .[fuse]
  244. EOF
  245. end
  246. def install_borg_no_fuse(boxname)
  247. return <<-EOF
  248. . ~/.bash_profile
  249. cd /vagrant/borg
  250. . borg-env/bin/activate
  251. pip install -U wheel # upgrade wheel, too old for 3.5
  252. cd borg
  253. # clean up (wrong/outdated) stuff we likely got via rsync:
  254. rm -f borg/*.so borg/*.cpy*
  255. rm -f borg/{chunker,crypto,compress,hashindex,platform_linux}.c
  256. rm -rf borg/__pycache__ borg/support/__pycache__ borg/testsuite/__pycache__
  257. pip install -r requirements.d/development.txt
  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. def install_pyinstaller(boxname)
  264. return <<-EOF
  265. . ~/.bash_profile
  266. cd /vagrant/borg
  267. . borg-env/bin/activate
  268. git clone https://github.com/thomaswaldmann/pyinstaller.git
  269. cd pyinstaller
  270. # develop branch, with fixed / freshly rebuilt bootloaders
  271. git checkout fresh-bootloader
  272. pip install -e .
  273. EOF
  274. end
  275. def install_pyinstaller_bootloader(boxname)
  276. return <<-EOF
  277. . ~/.bash_profile
  278. cd /vagrant/borg
  279. . borg-env/bin/activate
  280. git clone https://github.com/thomaswaldmann/pyinstaller.git
  281. cd pyinstaller
  282. # develop branch, with fixed / freshly rebuilt bootloaders
  283. git checkout fresh-bootloader
  284. # build bootloader, if it is not included
  285. cd bootloader
  286. python ./waf all
  287. cd ..
  288. pip install -e .
  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
  308. pyenv local 3.4.0 3.5.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 = 1
  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 = 768
  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("centos7_64")
  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.provision "install system packages", :type => :shell, :inline => packages_redhatted
  357. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("centos6_32")
  358. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("centos6_32")
  359. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("centos6_32")
  360. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg_no_fuse("centos6_32")
  361. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("centos6_32")
  362. end
  363. config.vm.define "centos6_64" do |b|
  364. b.vm.box = "centos6-64"
  365. b.vm.provider :virtualbox do |v|
  366. v.memory = 768
  367. end
  368. b.vm.provision "install system packages", :type => :shell, :inline => packages_redhatted
  369. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("centos6_64")
  370. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("centos6_64")
  371. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("centos6_64")
  372. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg_no_fuse("centos6_64")
  373. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("centos6_64")
  374. end
  375. config.vm.define "xenial64" do |b|
  376. b.vm.box = "ubuntu/xenial64"
  377. b.vm.provider :virtualbox do |v|
  378. v.memory = 768
  379. end
  380. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid
  381. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("xenial64")
  382. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("xenial64")
  383. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("xenial64")
  384. end
  385. config.vm.define "trusty64" do |b|
  386. b.vm.box = "ubuntu/trusty64"
  387. b.vm.provider :virtualbox do |v|
  388. v.memory = 768
  389. end
  390. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid
  391. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("trusty64")
  392. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("trusty64")
  393. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("trusty64")
  394. end
  395. config.vm.define "jessie64" do |b|
  396. b.vm.box = "debian/jessie64"
  397. b.vm.provider :virtualbox do |v|
  398. v.memory = 768
  399. end
  400. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid
  401. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("jessie64")
  402. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("jessie64")
  403. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("jessie64")
  404. end
  405. config.vm.define "wheezy32" do |b|
  406. b.vm.box = "boxcutter/debian7-i386"
  407. b.vm.provision "packages prepare wheezy", :type => :shell, :inline => packages_prepare_wheezy
  408. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid
  409. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("wheezy32")
  410. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("wheezy32")
  411. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("wheezy32")
  412. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("wheezy32")
  413. b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller("wheezy32")
  414. b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("wheezy32")
  415. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("wheezy32")
  416. end
  417. config.vm.define "wheezy64" do |b|
  418. b.vm.box = "boxcutter/debian7"
  419. b.vm.provision "packages prepare wheezy", :type => :shell, :inline => packages_prepare_wheezy
  420. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid
  421. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("wheezy64")
  422. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("wheezy64")
  423. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("wheezy64")
  424. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("wheezy64")
  425. b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller("wheezy64")
  426. b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("wheezy64")
  427. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("wheezy64")
  428. end
  429. # OS X
  430. config.vm.define "darwin64" do |b|
  431. b.vm.box = "jhcook/yosemite-clitools"
  432. b.vm.provision "packages darwin", :type => :shell, :privileged => false, :inline => packages_darwin
  433. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("darwin64")
  434. b.vm.provision "fix pyenv", :type => :shell, :privileged => false, :inline => fix_pyenv_darwin("darwin64")
  435. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("darwin64")
  436. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("darwin64")
  437. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("darwin64")
  438. b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller("darwin64")
  439. b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("darwin64")
  440. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("darwin64")
  441. end
  442. # BSD
  443. config.vm.define "freebsd64" do |b|
  444. b.vm.box = "geoffgarside/freebsd-10.2"
  445. b.vm.provider :virtualbox do |v|
  446. v.memory = 768
  447. end
  448. b.vm.provision "install system packages", :type => :shell, :inline => packages_freebsd
  449. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("freebsd")
  450. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("freebsd")
  451. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("freebsd")
  452. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("freebsd")
  453. b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller_bootloader("freebsd")
  454. b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("freebsd")
  455. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("freebsd")
  456. end
  457. config.vm.define "openbsd64" do |b|
  458. b.vm.box = "openbsd60-64" # note: basic openbsd install for vagrant WITH sudo and rsync pre-installed
  459. b.vm.provider :virtualbox do |v|
  460. v.memory = 768
  461. end
  462. b.vm.provision "packages openbsd", :type => :shell, :inline => packages_openbsd
  463. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("openbsd64")
  464. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg_no_fuse("openbsd64")
  465. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("openbsd64")
  466. end
  467. config.vm.define "netbsd64" do |b|
  468. b.vm.box = "netbsd70-64"
  469. b.vm.provider :virtualbox do |v|
  470. v.memory = 768
  471. end
  472. b.vm.provision "packages netbsd", :type => :shell, :inline => packages_netbsd
  473. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("netbsd64")
  474. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg_no_fuse("netbsd64")
  475. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("netbsd64")
  476. end
  477. config.vm.define "windows10" do |b|
  478. b.vm.box = "Microsoft/EdgeOnWindows10"
  479. b.vm.guest = :windows
  480. b.vm.boot_timeout = 180
  481. b.vm.graceful_halt_timeout = 120
  482. b.ssh.shell = "sh -l"
  483. b.ssh.username = "IEUser"
  484. b.ssh.password = "Passw0rd!"
  485. b.ssh.insert_key = false
  486. b.vm.provider :virtualbox do |v|
  487. v.memory = 2048
  488. #v.gui = true
  489. end
  490. # fix permissions placeholder
  491. b.vm.provision "fix perms", :type => :shell, :privileged => false, :inline => "echo 'fix permission placeholder'"
  492. b.vm.provision "packages cygwin", :type => :shell, :privileged => false, :inline => packages_cygwin("x86_64")
  493. b.vm.provision :reload
  494. b.vm.provision "cygwin install pip", :type => :shell, :privileged => false, :inline => install_cygwin_venv
  495. b.vm.provision "cygwin build env", :type => :shell, :privileged => false, :inline => build_sys_venv("windows10")
  496. b.vm.provision "cygwin install borg", :type => :shell, :privileged => false, :inline => install_borg_no_fuse("windows10")
  497. b.vm.provision "cygwin run tests", :type => :shell, :privileged => false, :inline => run_tests("windows10")
  498. end
  499. end