From bde80729419c827d94a0261fa65f3412982293a3 Mon Sep 17 00:00:00 2001 From: Victor LABORIE Date: Mon, 5 Mar 2018 18:24:14 +0100 Subject: [PATCH] Refactoring VagrantFile and add test section to README * nodes are set in an array * add ext4 nodes in addition to btrfs nodes * run bats test from nodes --- README.md | 24 +++++++++++++++++ Vagrantfile | 75 ++++++++++++++++++++++++++++------------------------- 2 files changed, 63 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index 54fa37e..81074a9 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,30 @@ Add this ligne > If you want mutiples backups in a day (1 by hour maximum) you can run `bkctld inc` multiples times > If you want keep incremental backup **for ever**, you just need don't run `bkctld rm` +## Test + +You can deploy tests environmments with Vagrant : + +~~~ +vagrant up +~~~ + +### Deployment + +Launch rsync-auto in a terminal for automatic synchronisation of your local code with Vagrant VM : + +~~~ +vagrant rsync-auto +~~~ + +### Bats + +You can run [bats](https://github.com/sstephenson/bats) test with *test* provisionner : + +~~~ +vagrant provision --provision-with test +~~~ + ## Usage ~~~ diff --git a/Vagrantfile b/Vagrantfile index be687fe..9eda20a 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -8,58 +8,61 @@ vagrantfile = File.join("#{Dir.home}", '.VagrantFile') load File.expand_path(vagrantfile) if File.exists?(vagrantfile) Vagrant.configure('2') do |config| - config.vm.synced_folder "./vagrant_share/", "/vagrant", disabled: true + config.vm.synced_folder "./", "/vagrant", type: "rsync", rsync__exclude: [ '.vagrant', '.git' ] config.vm.provider :libvirt do |libvirt| libvirt.storage :file, :size => '10G', :device => 'vdb' end + $install = <