Skip to content

Commit

Permalink
Merge pull request #33 from mortbauer/master
Browse files Browse the repository at this point in the history
add option log_level
  • Loading branch information
mjwwit authored Jul 11, 2022
2 parents b311cd7 + d199cb4 commit ea6b079
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
8 changes: 7 additions & 1 deletion upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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"
Expand Down

0 comments on commit ea6b079

Please sign in to comment.