From 8cc6611b3db7b7564150dad241e12970ca1981d9 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sat, 3 Nov 2018 14:01:54 -0300 Subject: Adds deploy action --- share/trashman/trashman/functions | 36 ++++++++++++++++++++++++++++++++++++ trashman | 13 +++++++++---- 2 files changed, 45 insertions(+), 4 deletions(-) diff --git a/share/trashman/trashman/functions b/share/trashman/trashman/functions index 78d527b..61102e9 100644 --- a/share/trashman/trashman/functions +++ b/share/trashman/trashman/functions @@ -224,3 +224,39 @@ trashman_check_sudo () { export SUDO="sudo" fi } + +# Deploy to a remote server +trashman_deploy () { + SERVER="$2" + RSYNC_PATH="sudo rsync" + DEPLOY_RSYNC="rsync -rltDv --no-perms --no-owner --delete --rsync-path" + SSH="ssh -T -q -o ConnectTimeout=15" + + trashman_echo "Deploying to $SERVER..." + + # Check remote environment + $SSH $SERVER <" + echo "usage: $BASENAME " echo "usage: $BASENAME [ ... ] [<--param1=value1> ... <--paramM=valueM>]" echo "" echo "available packages:" @@ -65,6 +68,8 @@ elif [ "$ACTION" = "fetch" ]; then trashman_$ACTION elif [ "$ACTION" = "merge" ]; then trashman_$ACTION +elif [ "$ACTION" = "deploy" ]; then + trashman_$ACTION $* elif [ "$ACTION" = "version" ]; then trashman_$ACTION else -- cgit v1.2.3