diff options
Diffstat (limited to 'utils/deploy.sh')
| -rwxr-xr-x | utils/deploy.sh | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/utils/deploy.sh b/utils/deploy.sh new file mode 100755 index 0000000..462cfdf --- /dev/null +++ b/utils/deploy.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# end up when failed +set -Eeuo pipefail + +if [ $# -eq 0 ]; then + echo 'Should provide least one argument' + exit 1 +fi + +if [ -z ${SSH_CLIENT+x} ]; then + ADDITIONAL_PARAM="--partial" +else + ADDITIONAL_PARAM="-Pv" +fi + +/usr/bin/date +%s > "packages/LASTSYNC" +/usr/bin/rsync $ADDITIONAL_PARAM -r -c --update --links --delete --exclude=.gitignore "packages/" $1:/var/www/repo/ |
