Vagrantfile 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521
  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. apt-get update
  13. # install all the (security and other) updates
  14. apt-get dist-upgrade -y
  15. # for building borgbackup and dependencies:
  16. apt-get install -y libssl-dev libacl1-dev liblz4-dev libfuse-dev fuse pkg-config
  17. usermod -a -G fuse vagrant
  18. apt-get install -y fakeroot build-essential git
  19. apt-get install -y python3-dev python3-setuptools
  20. # for building python:
  21. apt-get install -y zlib1g-dev libbz2-dev libncurses5-dev libreadline-dev liblzma-dev libsqlite3-dev
  22. # this way it works on older dists (like ubuntu 12.04) also:
  23. # for python 3.2 on ubuntu 12.04 we need pip<8 and virtualenv<14 as
  24. # newer versions are not compatible with py 3.2 any more.
  25. easy_install3 'pip<8.0'
  26. pip3 install 'virtualenv<14.0'
  27. touch ~vagrant/.bash_profile ; chown vagrant ~vagrant/.bash_profile
  28. EOF
  29. end
  30. def packages_redhatted
  31. return <<-EOF
  32. yum install -y epel-release
  33. yum update -y
  34. # for building borgbackup and dependencies:
  35. yum install -y openssl-devel openssl libacl-devel libacl lz4-devel fuse-devel fuse pkgconfig
  36. usermod -a -G fuse vagrant
  37. yum install -y fakeroot gcc git patch
  38. # needed to compile msgpack-python (otherwise it will use slow fallback code):
  39. yum install -y gcc-c++
  40. # for building python:
  41. yum install -y zlib-devel bzip2-devel ncurses-devel readline-devel xz xz-devel sqlite-devel
  42. #yum install -y python-pip
  43. #pip install virtualenv
  44. touch ~vagrant/.bash_profile ; chown vagrant ~vagrant/.bash_profile
  45. EOF
  46. end
  47. def packages_darwin
  48. return <<-EOF
  49. # install all the (security and other) updates
  50. sudo softwareupdate --install --all
  51. # get osxfuse 3.x pre-release code from github:
  52. curl -s -L https://github.com/osxfuse/osxfuse/releases/download/osxfuse-3.3.3/osxfuse-3.3.3.dmg >osxfuse.dmg
  53. MOUNTDIR=$(echo `hdiutil mount osxfuse.dmg | tail -1 | awk '{$1="" ; print $0}'` | xargs -0 echo) \
  54. && sudo installer -pkg "${MOUNTDIR}/Extras/FUSE for OS X 3.3.3.pkg" -target /
  55. sudo chown -R vagrant /usr/local # brew must be able to create stuff here
  56. ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  57. brew update
  58. brew install openssl
  59. brew install lz4
  60. brew install xz # required for python lzma module
  61. brew install fakeroot
  62. brew install git
  63. brew install pkgconfig
  64. touch ~vagrant/.bash_profile ; chown vagrant ~vagrant/.bash_profile
  65. EOF
  66. end
  67. def packages_freebsd
  68. return <<-EOF
  69. # install all the (security and other) updates, base system
  70. freebsd-update --not-running-from-cron fetch install
  71. # for building borgbackup and dependencies:
  72. pkg install -y openssl liblz4 fusefs-libs pkgconf
  73. pkg install -y fakeroot git bash
  74. # for building python:
  75. pkg install -y sqlite3
  76. # make bash default / work:
  77. chsh -s bash vagrant
  78. mount -t fdescfs fdesc /dev/fd
  79. echo 'fdesc /dev/fd fdescfs rw 0 0' >> /etc/fstab
  80. # make FUSE work
  81. echo 'fuse_load="YES"' >> /boot/loader.conf
  82. echo 'vfs.usermount=1' >> /etc/sysctl.conf
  83. kldload fuse
  84. sysctl vfs.usermount=1
  85. pw groupmod operator -M vagrant
  86. touch ~vagrant/.bash_profile ; chown vagrant ~vagrant/.bash_profile
  87. # install all the (security and other) updates, packages
  88. pkg update
  89. yes | pkg upgrade
  90. EOF
  91. end
  92. def packages_openbsd
  93. return <<-EOF
  94. . ~/.profile
  95. mkdir -p /home/vagrant/borg
  96. rsync -aH /vagrant/borg/ /home/vagrant/borg/
  97. rm -rf /vagrant/borg
  98. ln -sf /home/vagrant/borg /vagrant/
  99. pkg_add bash
  100. chsh -s /usr/local/bin/bash vagrant
  101. pkg_add openssl
  102. pkg_add lz4
  103. # pkg_add fuse # does not install, sdl dependency missing
  104. pkg_add git # no fakeroot
  105. pkg_add py3-setuptools
  106. ln -sf /usr/local/bin/python3.4 /usr/local/bin/python3
  107. ln -sf /usr/local/bin/python3.4 /usr/local/bin/python
  108. easy_install-3.4 pip
  109. pip3 install virtualenv
  110. touch ~vagrant/.bash_profile ; chown vagrant ~vagrant/.bash_profile
  111. EOF
  112. end
  113. def packages_netbsd
  114. return <<-EOF
  115. hostname netbsd # the box we use has an invalid hostname
  116. PKG_PATH="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/NetBSD/amd64/6.1.5/All/"
  117. export PKG_PATH
  118. pkg_add mozilla-rootcerts lz4 git bash
  119. chsh -s bash vagrant
  120. mkdir -p /usr/local/opt/lz4/include
  121. mkdir -p /usr/local/opt/lz4/lib
  122. ln -s /usr/pkg/include/lz4*.h /usr/local/opt/lz4/include/
  123. ln -s /usr/pkg/lib/liblz4* /usr/local/opt/lz4/lib/
  124. touch /etc/openssl/openssl.cnf # avoids a flood of "can't open ..."
  125. mozilla-rootcerts install
  126. pkg_add pkg-config # avoids some "pkg-config missing" error msg, even without fuse
  127. # pkg_add fuse # llfuse supports netbsd, but is still buggy.
  128. # https://bitbucket.org/nikratio/python-llfuse/issues/70/perfuse_open-setsockopt-no-buffer-space
  129. pkg_add python34 py34-setuptools
  130. ln -s /usr/pkg/bin/python3.4 /usr/pkg/bin/python
  131. ln -s /usr/pkg/bin/python3.4 /usr/pkg/bin/python3
  132. easy_install-3.4 pip
  133. pip install virtualenv
  134. touch ~vagrant/.bash_profile ; chown vagrant ~vagrant/.bash_profile
  135. EOF
  136. end
  137. def install_pyenv(boxname)
  138. return <<-EOF
  139. curl -s -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash
  140. echo 'export PATH="$HOME/.pyenv/bin:/vagrant/borg:$PATH"' >> ~/.bash_profile
  141. echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
  142. echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bash_profile
  143. echo 'export PYTHON_CONFIGURE_OPTS="--enable-shared"' >> ~/.bash_profile
  144. echo 'export LANG=en_US.UTF-8' >> ~/.bash_profile
  145. EOF
  146. end
  147. def fix_pyenv_darwin(boxname)
  148. return <<-EOF
  149. echo 'export PYTHON_CONFIGURE_OPTS="--enable-framework"' >> ~/.bash_profile
  150. EOF
  151. end
  152. def install_pythons(boxname)
  153. return <<-EOF
  154. . ~/.bash_profile
  155. pyenv install 3.4.0 # tests
  156. pyenv install 3.5.0 # tests
  157. pyenv install 3.5.2 # binary build, use latest 3.5.x release
  158. pyenv rehash
  159. EOF
  160. end
  161. def build_sys_venv(boxname)
  162. return <<-EOF
  163. . ~/.bash_profile
  164. cd /vagrant/borg
  165. virtualenv --python=python3 borg-env
  166. EOF
  167. end
  168. def build_pyenv_venv(boxname)
  169. return <<-EOF
  170. . ~/.bash_profile
  171. cd /vagrant/borg
  172. # use the latest 3.5 release
  173. pyenv global 3.5.2
  174. pyenv virtualenv 3.5.2 borg-env
  175. ln -s ~/.pyenv/versions/borg-env .
  176. EOF
  177. end
  178. def install_borg(boxname)
  179. return <<-EOF
  180. . ~/.bash_profile
  181. cd /vagrant/borg
  182. . borg-env/bin/activate
  183. pip install -U wheel # upgrade wheel, too old for 3.5
  184. cd borg
  185. # clean up (wrong/outdated) stuff we likely got via rsync:
  186. rm -f borg/*.so borg/*.cpy*
  187. rm -f borg/{chunker,crypto,compress,hashindex,platform_linux}.c
  188. rm -rf borg/__pycache__ borg/support/__pycache__ borg/testsuite/__pycache__
  189. pip install -r requirements.d/development.txt
  190. # by using [fuse], setup.py can handle different fuse requirements:
  191. pip install -e .[fuse]
  192. EOF
  193. end
  194. def install_borg_no_fuse(boxname)
  195. return <<-EOF
  196. . ~/.bash_profile
  197. cd /vagrant/borg
  198. . borg-env/bin/activate
  199. pip install -U wheel # upgrade wheel, too old for 3.5
  200. cd borg
  201. # clean up (wrong/outdated) stuff we likely got via rsync:
  202. rm -f borg/*.so borg/*.cpy*
  203. rm -f borg/{chunker,crypto,compress,hashindex,platform_linux}.c
  204. rm -rf borg/__pycache__ borg/support/__pycache__ borg/testsuite/__pycache__
  205. pip install -r requirements.d/development.txt
  206. pip install -e .
  207. EOF
  208. end
  209. def install_pyinstaller(boxname)
  210. return <<-EOF
  211. . ~/.bash_profile
  212. cd /vagrant/borg
  213. . borg-env/bin/activate
  214. git clone https://github.com/pyinstaller/pyinstaller.git
  215. cd pyinstaller
  216. git checkout v3.1.1
  217. pip install -e .
  218. EOF
  219. end
  220. def install_pyinstaller_bootloader(boxname)
  221. return <<-EOF
  222. . ~/.bash_profile
  223. cd /vagrant/borg
  224. . borg-env/bin/activate
  225. git clone https://github.com/pyinstaller/pyinstaller.git
  226. cd pyinstaller
  227. git checkout v3.1.1
  228. # build bootloader, if it is not included
  229. cd bootloader
  230. python ./waf all
  231. cd ..
  232. pip install -e .
  233. EOF
  234. end
  235. def build_binary_with_pyinstaller(boxname)
  236. return <<-EOF
  237. . ~/.bash_profile
  238. cd /vagrant/borg
  239. . borg-env/bin/activate
  240. cd borg
  241. pyinstaller -F -n borg.exe --distpath=/vagrant/borg --clean src/borg/__main__.py --hidden-import=borg.platform.posix
  242. EOF
  243. end
  244. def run_tests(boxname)
  245. return <<-EOF
  246. . ~/.bash_profile
  247. cd /vagrant/borg/borg
  248. . ../borg-env/bin/activate
  249. if which pyenv > /dev/null; then
  250. # for testing, use the earliest point releases of the supported python versions:
  251. pyenv global 3.4.0 3.5.0
  252. fi
  253. # otherwise: just use the system python
  254. if which fakeroot > /dev/null; then
  255. echo "Running tox WITH fakeroot -u"
  256. fakeroot -u tox --skip-missing-interpreters
  257. else
  258. echo "Running tox WITHOUT fakeroot -u"
  259. tox --skip-missing-interpreters
  260. fi
  261. EOF
  262. end
  263. def fix_perms
  264. return <<-EOF
  265. # . ~/.profile
  266. chown -R vagrant /vagrant/borg
  267. EOF
  268. end
  269. def windows_requirements
  270. return <<-EOF
  271. $url = "https://eternallybored.org/misc/wget/releases/wget-1.18-win64.zip"
  272. (New-Object System.Net.WebClient).DownloadFile($url, "./wget.zip")
  273. & { Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::ExtractToDirectory('wget.zip', './wget'); }
  274. wget\\wget.exe "http://gnuwin32.sourceforge.net/downlinks/tar-bin-zip.php" -O tar-bin.zip
  275. wget\\wget.exe "http://gnuwin32.sourceforge.net/downlinks/tar-dep-zip.php" -O tar-dep.zip
  276. & { Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::ExtractToDirectory('tar-bin.zip', './tar'); }
  277. & { Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::ExtractToDirectory('tar-dep.zip', './tar'); }
  278. wget\\wget.exe http://tukaani.org/xz/xz-5.2.1-windows.zip -O xz.zip
  279. & { Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::ExtractToDirectory('xz.zip', './xz'); }
  280. wget\\wget.exe -Axz "https://sourceforge.net/projects/msys2/files/Base/x86_64/msys2-base-x86_64-20160205.tar.xz/download" -O msys.tar.xz
  281. xz\\bin_x86-64\\xz -d msys.tar.xz
  282. tar\\bin\\tar -xf msys.tar
  283. msys64\\msys2.exe -c | more
  284. Start-Sleep -s 10
  285. msys64\\usr\\bin\\pacman --noconfirm -S mingw-w64-x86_64-python3 git mingw-w64-x86_64-lz4 mingw-w64-x86_64-python3-pip mingw-w64-x86_64-cython mingw-w64-x86_64-gcc mingw-w64-x86_64-ntldd-git
  286. python3 -m pip install --upgrade pip
  287. EOF
  288. end
  289. def windows_build
  290. return <<-EOF
  291. $msyspath = $(get-location).path + "\\msys64"
  292. $Env:Path = $Env:Path + ";" + $msyspath + "\\mingw64\\bin;" + $msyspath + "\\usr\\bin"
  293. net use x: \\\\vboxsvr\\vagrant
  294. x:
  295. pip3 install -r requirements.d/development.txt
  296. pip3 install -e .
  297. python3 deployment/windows/buildwin32.py
  298. EOF
  299. end
  300. Vagrant.configure(2) do |config|
  301. config.vm.provider :virtualbox do |v|
  302. #v.gui = true
  303. v.cpus = 1
  304. end
  305. # Linux
  306. config.vm.define "centos7_64" do |b|
  307. b.vm.synced_folder ".", "/vagrant/borg/borg", :type => "rsync", :rsync__args => ["--verbose", "--archive", "--delete", "-z"]
  308. b.vm.synced_folder ".", "/vagrant", disabled: true
  309. b.vm.provision "fix perms", :type => :shell, :inline => fix_perms
  310. b.vm.box = "centos/7"
  311. b.vm.provider :virtualbox do |v|
  312. v.memory = 768
  313. end
  314. b.vm.provision "install system packages", :type => :shell, :inline => packages_redhatted
  315. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("centos7_64")
  316. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("centos7_64")
  317. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("centos7_64")
  318. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("centos7_64")
  319. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("centos7_64")
  320. end
  321. config.vm.define "centos6_32" do |b|
  322. b.vm.synced_folder ".", "/vagrant/borg/borg", :type => "rsync", :rsync__args => ["--verbose", "--archive", "--delete", "-z"]
  323. b.vm.synced_folder ".", "/vagrant", disabled: true
  324. b.vm.provision "fix perms", :type => :shell, :inline => fix_perms
  325. b.vm.box = "centos6-32"
  326. b.vm.provision "install system packages", :type => :shell, :inline => packages_redhatted
  327. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("centos6_32")
  328. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("centos6_32")
  329. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("centos6_32")
  330. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg_no_fuse("centos6_32")
  331. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("centos6_32")
  332. end
  333. config.vm.define "centos6_64" do |b|
  334. b.vm.synced_folder ".", "/vagrant/borg/borg", :type => "rsync", :rsync__args => ["--verbose", "--archive", "--delete", "-z"]
  335. b.vm.synced_folder ".", "/vagrant", disabled: true
  336. b.vm.provision "fix perms", :type => :shell, :inline => fix_perms
  337. b.vm.box = "centos6-64"
  338. b.vm.provider :virtualbox do |v|
  339. v.memory = 768
  340. end
  341. b.vm.provision "install system packages", :type => :shell, :inline => packages_redhatted
  342. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("centos6_64")
  343. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("centos6_64")
  344. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("centos6_64")
  345. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg_no_fuse("centos6_64")
  346. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("centos6_64")
  347. end
  348. config.vm.define "xenial64" do |b|
  349. b.vm.synced_folder ".", "/vagrant/borg/borg", :type => "rsync", :rsync__args => ["--verbose", "--archive", "--delete", "-z"]
  350. b.vm.synced_folder ".", "/vagrant", disabled: true
  351. b.vm.provision "fix perms", :type => :shell, :inline => fix_perms
  352. b.vm.box = "ubuntu/xenial64"
  353. b.vm.provider :virtualbox do |v|
  354. v.memory = 768
  355. end
  356. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid
  357. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("trusty64")
  358. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("trusty64")
  359. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("trusty64")
  360. end
  361. config.vm.define "trusty64" do |b|
  362. b.vm.synced_folder ".", "/vagrant/borg/borg", :type => "rsync", :rsync__args => ["--verbose", "--archive", "--delete", "-z"]
  363. b.vm.synced_folder ".", "/vagrant", disabled: true
  364. b.vm.provision "fix perms", :type => :shell, :inline => fix_perms
  365. b.vm.box = "ubuntu/trusty64"
  366. b.vm.provider :virtualbox do |v|
  367. v.memory = 768
  368. end
  369. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid
  370. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("trusty64")
  371. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("trusty64")
  372. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("trusty64")
  373. end
  374. config.vm.define "jessie64" do |b|
  375. b.vm.synced_folder ".", "/vagrant/borg/borg", :type => "rsync", :rsync__args => ["--verbose", "--archive", "--delete", "-z"]
  376. b.vm.synced_folder ".", "/vagrant", disabled: true
  377. b.vm.provision "fix perms", :type => :shell, :inline => fix_perms
  378. b.vm.box = "debian/jessie64"
  379. b.vm.provider :virtualbox do |v|
  380. v.memory = 768
  381. end
  382. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid
  383. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("jessie64")
  384. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("jessie64")
  385. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("jessie64")
  386. end
  387. config.vm.define "wheezy32" do |b|
  388. b.vm.synced_folder ".", "/vagrant/borg/borg", :type => "rsync", :rsync__args => ["--verbose", "--archive", "--delete", "-z"]
  389. b.vm.synced_folder ".", "/vagrant", disabled: true
  390. b.vm.provision "fix perms", :type => :shell, :inline => fix_perms
  391. b.vm.box = "boxcutter/debian79-i386"
  392. b.vm.provision "packages prepare wheezy", :type => :shell, :inline => packages_prepare_wheezy
  393. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid
  394. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("wheezy32")
  395. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("wheezy32")
  396. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("wheezy32")
  397. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("wheezy32")
  398. b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller("wheezy32")
  399. b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("wheezy32")
  400. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("wheezy32")
  401. end
  402. config.vm.define "wheezy64" do |b|
  403. b.vm.synced_folder ".", "/vagrant/borg/borg", :type => "rsync", :rsync__args => ["--verbose", "--archive", "--delete", "-z"]
  404. b.vm.synced_folder ".", "/vagrant", disabled: true
  405. b.vm.provision "fix perms", :type => :shell, :inline => fix_perms
  406. b.vm.box = "boxcutter/debian79"
  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("wheezy64")
  410. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("wheezy64")
  411. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("wheezy64")
  412. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("wheezy64")
  413. b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller("wheezy64")
  414. b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("wheezy64")
  415. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("wheezy64")
  416. end
  417. # OS X
  418. config.vm.define "darwin64" do |b|
  419. b.vm.synced_folder ".", "/vagrant/borg/borg", :type => "rsync", :rsync__args => ["--verbose", "--archive", "--delete", "-z"]
  420. b.vm.synced_folder ".", "/vagrant", disabled: true
  421. b.vm.provision "fix perms", :type => :shell, :inline => fix_perms
  422. b.vm.box = "jhcook/yosemite-clitools"
  423. b.vm.provision "packages darwin", :type => :shell, :privileged => false, :inline => packages_darwin
  424. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("darwin64")
  425. b.vm.provision "fix pyenv", :type => :shell, :privileged => false, :inline => fix_pyenv_darwin("darwin64")
  426. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("darwin64")
  427. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("darwin64")
  428. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("darwin64")
  429. b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller("darwin64")
  430. b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("darwin64")
  431. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("darwin64")
  432. end
  433. # BSD
  434. config.vm.define "freebsd64" do |b|
  435. b.vm.synced_folder ".", "/vagrant/borg/borg", :type => "rsync", :rsync__args => ["--verbose", "--archive", "--delete", "-z"]
  436. b.vm.synced_folder ".", "/vagrant", disabled: true
  437. b.vm.provision "fix perms", :type => :shell, :inline => fix_perms
  438. b.vm.box = "geoffgarside/freebsd-10.2"
  439. b.vm.provider :virtualbox do |v|
  440. v.memory = 768
  441. end
  442. b.vm.provision "install system packages", :type => :shell, :inline => packages_freebsd
  443. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("freebsd")
  444. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("freebsd")
  445. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("freebsd")
  446. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("freebsd")
  447. b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller_bootloader("freebsd")
  448. b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("freebsd")
  449. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("freebsd")
  450. end
  451. config.vm.define "openbsd64" do |b|
  452. b.vm.box = "kaorimatz/openbsd-5.9-amd64"
  453. b.vm.provider :virtualbox do |v|
  454. v.memory = 768
  455. end
  456. b.vm.provision "packages openbsd", :type => :shell, :inline => packages_openbsd
  457. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("openbsd64")
  458. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg_no_fuse("openbsd64")
  459. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("openbsd64")
  460. end
  461. config.vm.define "netbsd64" do |b|
  462. b.vm.synced_folder ".", "/vagrant/borg/borg", :type => "rsync", :rsync__args => ["--verbose", "--archive", "--delete", "-z"]
  463. b.vm.synced_folder ".", "/vagrant", disabled: true
  464. b.vm.provision "fix perms", :type => :shell, :inline => fix_perms
  465. b.vm.box = "alex-skimlinks/netbsd-6.1.5-amd64"
  466. b.vm.provider :virtualbox do |v|
  467. v.memory = 768
  468. end
  469. b.vm.provision "packages netbsd", :type => :shell, :inline => packages_netbsd
  470. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("netbsd64")
  471. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg_no_fuse("netbsd64")
  472. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("netbsd64")
  473. end
  474. config.vm.define "windows" do |b|
  475. b.vm.communicator = "winrm"
  476. # Defaults for vagrant box from Microsoft
  477. # b.winrm.username = "IEUser"
  478. # b.winrm.password = "Passw0rd!"
  479. # b.ssh.username = "IEUser"
  480. # b.ssh.password = "Passw0rd!"
  481. b.vm.box = "joeapearson/win10-x64"
  482. b.vm.provision "install msys2", :type => :shell, :privileged => false, :inline => windows_requirements
  483. b.vm.provision "build", :type => :shell, :privileged => false, :inline => windows_build
  484. end
  485. end