From d199cb4ecd683d0b412c52f8b69384c96ee26b58 Mon Sep 17 00:00:00 2001 From: Martin Ortbauer Date: Mon, 11 Jul 2022 12:28:21 +0200 Subject: [PATCH] add option log_level --- DOCS.md | 1 + upload.sh | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/DOCS.md b/DOCS.md index 84765a2..6e9839b 100644 --- a/DOCS.md +++ b/DOCS.md @@ -15,6 +15,7 @@ The following parameters are used to configure the plugin: - **args** - instruct plugin to use these additional rsync CLI arguments, example: `"--blocking-io"` - **prescript** - list of commands to execute on remote machines before rsync occurs - **script** - list of commands to execute on remote machines after rsync occurs +- **log_level** - ssh log level, defaults to quiet It is highly recommended to put your private key into a secret (`rsync_key`) so it is not exposed to users. This can be done using the drone-cli: diff --git a/upload.sh b/upload.sh index 86feda0..404b327 100755 --- a/upload.sh +++ b/upload.sh @@ -46,6 +46,12 @@ else ARGS=$PLUGIN_ARGS fi +if [ -z "$PLUGIN_LOG_LEVEL" ]; then + LOG_LEVEL=quiet +else + LOG_LEVEL=$PLUGIN_LOG_LEVEL +fi + # Building rsync command expr="rsync -az $ARGS" @@ -57,7 +63,7 @@ if [[ -n "$PLUGIN_DELETE" && "$PLUGIN_DELETE" == "true" ]]; then expr="$expr --del" fi -expr="$expr -e 'ssh -p %s -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -o StrictHostKeyChecking=no'" +expr="$expr -e 'ssh -p %s -o UserKnownHostsFile=/dev/null -o LogLevel=$LOG_LEVEL -o StrictHostKeyChecking=no'" # Include IFS=','; read -ra INCLUDE <<< "$PLUGIN_INCLUDE"