From b7070bec42835a6036febe6f9affbf7bc3b366a6 Mon Sep 17 00:00:00 2001 From: Chris Hawes Date: Tue, 10 Jan 2017 21:49:45 +0000 Subject: [PATCH] Allow passing of extra arguments to rsync --- README.md | 1 + upload.sh | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 71d4030..1b84f45 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ docker run --rm \ -e PLUGIN_HOSTS="127.0.0.1" \ -e PLUGIN_TARGET="./" \ -e PLUGIN_SCRIPT="echo \"Done!\"" \ + -e PLUGIN_ARGS="--blocking-io" \ -v $(pwd):$(pwd) \ -w $(pwd) \ drillster/drone-rsync diff --git a/upload.sh b/upload.sh index 1609c3c..383be89 100755 --- a/upload.sh +++ b/upload.sh @@ -41,8 +41,14 @@ if [ -z "$RSYNC_KEY" ]; then SSH_KEY=$PLUGIN_KEY fi +if [ -z "$PLUGIN_ARGS" ]; then + ARGS= +else + ARGS=$PLUGIN_ARGS +fi + # Building rsync command -expr="rsync -az" +expr="rsync -az $ARGS" if [[ -n "$PLUGIN_RECURSIVE" && "$PLUGIN_RECURSIVE" == "true" ]]; then expr="$expr -r"