From: Silvio Rhatto Date: Sat, 3 Nov 2018 17:01:54 +0000 (-0300) Subject: Adds deploy action X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=8cc6611b3db7b7564150dad241e12970ca1981d9;p=trashman.git Adds deploy action --- 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