Vagrantfile 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554
  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(version)
  40. script = <<-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. if version == "centos6"
  58. script += <<-EOF
  59. # avoid that breaking llfuse install breaks borgbackup install under tox:
  60. sed -i.bak '/fuse.txt/d' /vagrant/borg/borg/tox.ini
  61. EOF
  62. end
  63. return script
  64. end
  65. def packages_darwin
  66. return <<-EOF
  67. # install all the (security and other) updates
  68. sudo softwareupdate --install --all
  69. # get osxfuse 3.x release code from github:
  70. curl -s -L https://github.com/osxfuse/osxfuse/releases/download/osxfuse-3.5.2/osxfuse-3.5.2.dmg >osxfuse.dmg
  71. MOUNTDIR=$(echo `hdiutil mount osxfuse.dmg | tail -1 | awk '{$1="" ; print $0}'` | xargs -0 echo) \
  72. && sudo installer -pkg "${MOUNTDIR}/Extras/FUSE for macOS 3.5.2.pkg" -target /
  73. sudo chown -R vagrant /usr/local # brew must be able to create stuff here
  74. ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  75. brew update
  76. brew install openssl
  77. brew install lz4
  78. brew install xz # required for python lzma module
  79. brew install fakeroot
  80. brew install git
  81. brew install pkg-config
  82. touch ~vagrant/.bash_profile ; chown vagrant ~vagrant/.bash_profile
  83. EOF
  84. end
  85. def packages_freebsd
  86. return <<-EOF
  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 fakeroot 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. . ~/.profile
  115. pkg_add bash
  116. chsh -s /usr/local/bin/bash vagrant
  117. pkg_add openssl
  118. pkg_add lz4
  119. pkg_add git # no fakeroot
  120. pkg_add py3-setuptools
  121. ln -sf /usr/local/bin/python3.4 /usr/local/bin/python3
  122. ln -sf /usr/local/bin/python3.4 /usr/local/bin/python
  123. easy_install-3.4 pip
  124. pip3 install virtualenv
  125. touch ~vagrant/.bash_profile ; chown vagrant ~vagrant/.bash_profile
  126. # avoid that breaking llfuse install breaks borgbackup install under tox:
  127. sed -i.bak '/fuse.txt/d' /vagrant/borg/borg/tox.ini
  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
  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. # fuse does not work good enough (see above), do not install llfuse:
  153. sed -i.bak '/fuse.txt/d' /vagrant/borg/borg/tox.ini
  154. EOF
  155. end
  156. # Install required cygwin packages and configure environment
  157. #
  158. # Microsoft/EdgeOnWindows10 image has MLS-OpenSSH installed by default,
  159. # which is based on cygwin x86_64 but should not be used together with cygwin.
  160. # In order to have have cygwin compatible bash 'ImagePath' is replaced with
  161. # cygrunsrv of newly installed cygwin
  162. #
  163. # supported cygwin versions:
  164. # x86_64
  165. # x86
  166. def packages_cygwin(version)
  167. setup_exe = "setup-#{version}.exe"
  168. return <<-EOF
  169. mkdir -p /cygdrive/c/cygwin
  170. powershell -Command '$client = new-object System.Net.WebClient; $client.DownloadFile("https://www.cygwin.com/#{setup_exe}","C:\\cygwin\\#{setup_exe}")'
  171. echo '
  172. REM --- Change to use different CygWin platform and final install path
  173. set CYGSETUP=#{setup_exe}
  174. REM --- Install build version of CygWin in a subfolder
  175. set OURPATH=%cd%
  176. set CYGBUILD="C:\\cygwin\\CygWin"
  177. set CYGMIRROR=ftp://mirrors.kernel.org/sourceware/cygwin/
  178. set BUILDPKGS=python3,python3-setuptools,binutils,gcc-g++,libopenssl,openssl-devel,git,make,openssh,liblz4-devel,liblz4_1,rsync,curl,python-devel
  179. %CYGSETUP% -q -B -o -n -R %CYGBUILD% -L -D -s %CYGMIRROR% -P %BUILDPKGS%
  180. cd /d C:\\cygwin\\CygWin\\bin
  181. regtool set /HKLM/SYSTEM/CurrentControlSet/Services/OpenSSHd/ImagePath "C:\\cygwin\\CygWin\\bin\\cygrunsrv.exe"
  182. bash -c "ssh-host-config --no"
  183. ' > /cygdrive/c/cygwin/install.bat
  184. cd /cygdrive/c/cygwin && cmd.exe /c install.bat
  185. echo "alias mkdir='mkdir -p'" > ~/.profile
  186. echo "export CYGWIN_ROOT=/cygdrive/c/cygwin/CygWin" >> ~/.profile
  187. echo 'export PATH=$PATH:$CYGWIN_ROOT/bin' >> ~/.profile
  188. echo '' > ~/.bash_profile
  189. cmd.exe /c 'setx /m PATH "%PATH%;C:\\cygwin\\CygWin\\bin"'
  190. source ~/.profile
  191. echo 'db_home: windows' > $CYGWIN_ROOT/etc/nsswitch.conf
  192. EOF
  193. end
  194. def install_cygwin_venv
  195. return <<-EOF
  196. easy_install-3.4 pip
  197. pip install virtualenv
  198. EOF
  199. end
  200. def install_pyenv(boxname)
  201. return <<-EOF
  202. curl -s -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash
  203. echo 'export PATH="$HOME/.pyenv/bin:/vagrant/borg:$PATH"' >> ~/.bash_profile
  204. echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
  205. echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bash_profile
  206. echo 'export PYTHON_CONFIGURE_OPTS="--enable-shared"' >> ~/.bash_profile
  207. echo 'export LANG=en_US.UTF-8' >> ~/.bash_profile
  208. EOF
  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.5.2 # binary build, use latest 3.5.x release
  221. pyenv rehash
  222. EOF
  223. end
  224. def build_sys_venv(boxname)
  225. return <<-EOF
  226. . ~/.bash_profile
  227. cd /vagrant/borg
  228. virtualenv --python=python3 borg-env
  229. EOF
  230. end
  231. def build_pyenv_venv(boxname)
  232. return <<-EOF
  233. . ~/.bash_profile
  234. cd /vagrant/borg
  235. # use the latest 3.5 release
  236. pyenv global 3.5.2
  237. pyenv virtualenv 3.5.2 borg-env
  238. ln -s ~/.pyenv/versions/borg-env .
  239. EOF
  240. end
  241. def install_borg(boxname)
  242. return <<-EOF
  243. . ~/.bash_profile
  244. cd /vagrant/borg
  245. . borg-env/bin/activate
  246. pip install -U wheel # upgrade wheel, too old for 3.5
  247. cd borg
  248. # clean up (wrong/outdated) stuff we likely got via rsync:
  249. rm -f borg/*.so borg/*.cpy*
  250. rm -f borg/{chunker,crypto,compress,hashindex,platform_linux}.c
  251. rm -rf borg/__pycache__ borg/support/__pycache__ borg/testsuite/__pycache__
  252. pip install -r requirements.d/development.txt
  253. # by using [fuse], setup.py can handle different fuse requirements:
  254. pip install -e .[fuse]
  255. EOF
  256. end
  257. def install_borg_no_fuse(boxname)
  258. return <<-EOF
  259. . ~/.bash_profile
  260. cd /vagrant/borg
  261. . borg-env/bin/activate
  262. pip install -U wheel # upgrade wheel, too old for 3.5
  263. cd borg
  264. # clean up (wrong/outdated) stuff we likely got via rsync:
  265. rm -f borg/*.so borg/*.cpy*
  266. rm -f borg/{chunker,crypto,compress,hashindex,platform_linux}.c
  267. rm -rf borg/__pycache__ borg/support/__pycache__ borg/testsuite/__pycache__
  268. pip install -r requirements.d/development.txt
  269. pip install -e .
  270. EOF
  271. end
  272. def install_pyinstaller(boxname)
  273. return <<-EOF
  274. . ~/.bash_profile
  275. cd /vagrant/borg
  276. . borg-env/bin/activate
  277. git clone https://github.com/pyinstaller/pyinstaller.git
  278. cd pyinstaller
  279. git checkout v3.1.1
  280. pip install -e .
  281. EOF
  282. end
  283. def install_pyinstaller_bootloader(boxname)
  284. return <<-EOF
  285. . ~/.bash_profile
  286. cd /vagrant/borg
  287. . borg-env/bin/activate
  288. git clone https://github.com/pyinstaller/pyinstaller.git
  289. cd pyinstaller
  290. git checkout v3.1.1
  291. # build bootloader, if it is not included
  292. cd bootloader
  293. python ./waf all
  294. cd ..
  295. pip install -e .
  296. EOF
  297. end
  298. def build_binary_with_pyinstaller(boxname)
  299. return <<-EOF
  300. . ~/.bash_profile
  301. cd /vagrant/borg
  302. . borg-env/bin/activate
  303. cd borg
  304. pyinstaller --clean --distpath=/vagrant/borg scripts/borg.exe.spec
  305. EOF
  306. end
  307. def run_tests(boxname)
  308. return <<-EOF
  309. . ~/.bash_profile
  310. cd /vagrant/borg/borg
  311. . ../borg-env/bin/activate
  312. if which pyenv 2> /dev/null; then
  313. # for testing, use the earliest point releases of the supported python versions:
  314. pyenv global 3.4.0 3.5.0
  315. fi
  316. # otherwise: just use the system python
  317. if which fakeroot 2> /dev/null; then
  318. echo "Running tox WITH fakeroot -u"
  319. fakeroot -u tox --skip-missing-interpreters
  320. else
  321. echo "Running tox WITHOUT fakeroot -u"
  322. tox --skip-missing-interpreters
  323. fi
  324. EOF
  325. end
  326. def fix_perms
  327. return <<-EOF
  328. # . ~/.profile
  329. if id "vagrant" >/dev/null 2>&1; then
  330. chown -R vagrant /vagrant/borg
  331. else
  332. chown -R ubuntu /vagrant/borg
  333. fi
  334. EOF
  335. end
  336. Vagrant.configure(2) do |config|
  337. # use rsync to copy content to the folder
  338. config.vm.synced_folder ".", "/vagrant/borg/borg", :type => "rsync", :rsync__args => ["--verbose", "--archive", "--delete", "-z"], :rsync__chown => false
  339. # do not let the VM access . on the host machine via the default shared folder!
  340. config.vm.synced_folder ".", "/vagrant", disabled: true
  341. # fix permissions on synced folder
  342. config.vm.provision "fix perms", :type => :shell, :inline => fix_perms
  343. config.vm.provider :virtualbox do |v|
  344. #v.gui = true
  345. v.cpus = 1
  346. end
  347. # Linux
  348. config.vm.define "centos7_64" do |b|
  349. b.vm.box = "centos/7"
  350. b.vm.provider :virtualbox do |v|
  351. v.memory = 768
  352. end
  353. b.vm.provision "install system packages", :type => :shell, :inline => packages_redhatted("centos7")
  354. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("centos7_64")
  355. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("centos7_64")
  356. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("centos7_64")
  357. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("centos7_64")
  358. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("centos7_64")
  359. end
  360. config.vm.define "centos6_32" do |b|
  361. b.vm.box = "centos6-32"
  362. b.vm.provision "install system packages", :type => :shell, :inline => packages_redhatted("centos6")
  363. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("centos6_32")
  364. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("centos6_32")
  365. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("centos6_32")
  366. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg_no_fuse("centos6_32")
  367. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("centos6_32")
  368. end
  369. config.vm.define "centos6_64" do |b|
  370. b.vm.box = "centos6-64"
  371. b.vm.provider :virtualbox do |v|
  372. v.memory = 768
  373. end
  374. b.vm.provision "install system packages", :type => :shell, :inline => packages_redhatted("centos6")
  375. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("centos6_64")
  376. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("centos6_64")
  377. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("centos6_64")
  378. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg_no_fuse("centos6_64")
  379. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("centos6_64")
  380. end
  381. config.vm.define "xenial64" do |b|
  382. b.vm.box = "ubuntu/xenial64"
  383. b.vm.provider :virtualbox do |v|
  384. v.memory = 768
  385. end
  386. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid
  387. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("xenial64")
  388. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("xenial64")
  389. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("xenial64")
  390. end
  391. config.vm.define "trusty64" do |b|
  392. b.vm.box = "ubuntu/trusty64"
  393. b.vm.provider :virtualbox do |v|
  394. v.memory = 768
  395. end
  396. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid
  397. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("trusty64")
  398. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("trusty64")
  399. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("trusty64")
  400. end
  401. config.vm.define "jessie64" do |b|
  402. b.vm.box = "debian/jessie64"
  403. b.vm.provider :virtualbox do |v|
  404. v.memory = 768
  405. end
  406. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid
  407. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("jessie64")
  408. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("jessie64")
  409. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("jessie64")
  410. end
  411. config.vm.define "wheezy32" do |b|
  412. b.vm.box = "boxcutter/debian7-i386"
  413. b.vm.provision "packages prepare wheezy", :type => :shell, :inline => packages_prepare_wheezy
  414. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid
  415. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("wheezy32")
  416. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("wheezy32")
  417. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("wheezy32")
  418. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("wheezy32")
  419. b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller("wheezy32")
  420. b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("wheezy32")
  421. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("wheezy32")
  422. end
  423. config.vm.define "wheezy64" do |b|
  424. b.vm.box = "boxcutter/debian7"
  425. b.vm.provision "packages prepare wheezy", :type => :shell, :inline => packages_prepare_wheezy
  426. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid
  427. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("wheezy64")
  428. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("wheezy64")
  429. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("wheezy64")
  430. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("wheezy64")
  431. b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller("wheezy64")
  432. b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("wheezy64")
  433. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("wheezy64")
  434. end
  435. # OS X
  436. config.vm.define "darwin64" do |b|
  437. b.vm.box = "jhcook/yosemite-clitools"
  438. b.vm.provision "packages darwin", :type => :shell, :privileged => false, :inline => packages_darwin
  439. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("darwin64")
  440. b.vm.provision "fix pyenv", :type => :shell, :privileged => false, :inline => fix_pyenv_darwin("darwin64")
  441. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("darwin64")
  442. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("darwin64")
  443. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("darwin64")
  444. b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller("darwin64")
  445. b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("darwin64")
  446. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("darwin64")
  447. end
  448. # BSD
  449. config.vm.define "freebsd64" do |b|
  450. b.vm.box = "geoffgarside/freebsd-10.2"
  451. b.vm.provider :virtualbox do |v|
  452. v.memory = 768
  453. end
  454. b.vm.provision "install system packages", :type => :shell, :inline => packages_freebsd
  455. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("freebsd")
  456. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("freebsd")
  457. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("freebsd")
  458. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("freebsd")
  459. b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller_bootloader("freebsd")
  460. b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("freebsd")
  461. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("freebsd")
  462. end
  463. config.vm.define "openbsd64" do |b|
  464. b.vm.box = "openbsd60-64" # note: basic openbsd install for vagrant WITH sudo and rsync pre-installed
  465. b.vm.provider :virtualbox do |v|
  466. v.memory = 768
  467. end
  468. b.vm.provision "packages openbsd", :type => :shell, :inline => packages_openbsd
  469. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("openbsd64")
  470. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg_no_fuse("openbsd64")
  471. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("openbsd64")
  472. end
  473. config.vm.define "netbsd64" do |b|
  474. b.vm.box = "netbsd70-64"
  475. b.vm.provider :virtualbox do |v|
  476. v.memory = 768
  477. end
  478. b.vm.provision "packages netbsd", :type => :shell, :inline => packages_netbsd
  479. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("netbsd64")
  480. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg_no_fuse("netbsd64")
  481. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("netbsd64")
  482. end
  483. config.vm.define "windows10" do |b|
  484. b.vm.box = "Microsoft/EdgeOnWindows10"
  485. b.vm.guest = :windows
  486. b.vm.boot_timeout = 180
  487. b.vm.graceful_halt_timeout = 120
  488. b.ssh.shell = "sh -l"
  489. b.ssh.username = "IEUser"
  490. b.ssh.password = "Passw0rd!"
  491. b.ssh.insert_key = false
  492. b.vm.provider :virtualbox do |v|
  493. v.memory = 2048
  494. #v.gui = true
  495. end
  496. # fix permissions placeholder
  497. b.vm.provision "fix perms", :type => :shell, :privileged => false, :inline => "echo 'fix permission placeholder'"
  498. b.vm.provision "packages cygwin", :type => :shell, :privileged => false, :inline => packages_cygwin("x86_64")
  499. b.vm.provision :reload
  500. b.vm.provision "cygwin install pip", :type => :shell, :privileged => false, :inline => install_cygwin_venv
  501. b.vm.provision "cygwin build env", :type => :shell, :privileged => false, :inline => build_sys_venv("windows10")
  502. b.vm.provision "cygwin install borg", :type => :shell, :privileged => false, :inline => install_borg_no_fuse("windows10")
  503. b.vm.provision "cygwin run tests", :type => :shell, :privileged => false, :inline => run_tests("windows10")
  504. end
  505. end