leighmcculloch / docker-unison

A docker data container using Unison for fast folder sync. An alternative to slow boot2docker volumes on OS X.
GNU General Public License v3.0
167 stars 26 forks source link

Support more flexible, faster development cycles #11

Closed botimer closed 8 years ago

botimer commented 8 years ago

There are two small commits here with detailed messages. They add "-repeat watch" support and allow configuring the replica path. This combination enhances the ease of use and performance for development.

Here is a handy shell alias to start syncing from the current directory to an active Docker machine instance. This does require unison-fsmonitor to be set up on the client as well.

function dsync() {
    MACHINE=""
    if [[ -n $1 ]]; then
        MACHINE=$1
    else
        MACHINE="$(dm active)"
    fi

    HOST="$(dm ip $MACHINE)"
    PORT=5000
    if [[ -n $2 ]]; then
        PORT=$2
    fi

    unison . socket://$HOST:$PORT/ -ignore 'Path .git' -ignore 'Path tmp' -auto -batch -prefer . -repeat watch -fastcheck true
}
leighmcculloch commented 8 years ago

@botimer Thanks so much for submitting this PR! It looks good. Before I merge it, can you remove the second commit since that feature was already provided by #6, and update the commit message of the first commit to remove mention of -repeat which is a detail. e.g. Install and link unison-fsmonitor. Once that's done, mention me here and I'll merge!

botimer commented 8 years ago

@leighmcculloch This is now cleaned up as requested. Thanks for checking it out!