Git Product home page Git Product logo

vagrant-unison's Introduction

Vagrant Unison Plugin

This is a Vagrant 1.1+ plugin that syncs files over SSH from a local folder to your Vagrant VM (local or on AWS). Under the covers it uses Unison

NOTE: This plugin requires Vagrant 1.1+,

Features

  • Unisoned folder support via unison over ssh -> will work with any vagrant provider, eg Virtualbox or AWS.

Usage

  1. You must already have Unison installed and in your path.
  2. Install using standard Vagrant 1.1+ plugin installation methods.
$ vagrant plugin install vagrant-unison
  1. After installing, edit your Vagrantfile and add a configuration directive similar to the below: NOTE: This works with only one synced folder for now.
Vagrant.configure("2") do |config|
  config.vm.box = "dummy"
  config.vm.synced_folder '.', '/vagrant', type: "unison", repeat: 2
end
  1. Start up your starting your vagrant box as normal (eg: vagrant up)

Start syncing Folders

Run vagrant sync to start watching the local_folder for changes, and syncing these to your vagrang VM.

Under the covers this uses your system installation of Unison, which must be installed in your path.

Start syncing Folders in repeat mode

Run vagrant sync-repeat to start in bidirect monitor (repeat) mode.

Start syncing Folders in interactive mode

Run vagrant sync-interact to start in interactive mode that allows solving conflicts.

Cleanup unison database

When you get

Fatal error: Warning: inconsistent state.  
The archive file is missing on some hosts.
For safety, the remaining copies should be deleted.
  Archive arb126d8de1ef26a835b94cf51975c530f on host blablabla.local should be DELETED
  Archive arbc6a36f85b3d1473c55565dd220acf68 on host blablabla is MISSING
Please delete archive files as appropriate and try again
or invoke Unison with -ignorearchives flag.

Run vagrant sync-cleanup to clear Archive from ~/Library/Application Support/Unison/ and files from host folder. Running Unison with -ignorearchives flag is a bad idea, since it will produce conflicts.

Development

To work on the vagrant-unison plugin, clone this repository out, and use Bundler to get the dependencies:

$ bundle

Once you have the dependencies, verify the unit tests pass with rake:

$ bundle exec rake

If those pass, you're ready to start developing the plugin. You can test the plugin without installing it into your Vagrant environment by just creating a Vagrantfile in the top level of this directory (it is gitignored) that uses it, and uses bundler to execute Vagrant:

$ bundle exec vagrant up 
$ bundle exec vagrant sync

vagrant-unison's People

Contributors

mrdavidlaing avatar dmatora avatar edtoon avatar leemhenson avatar

Watchers

Ran Cohen avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.