aboutsummaryrefslogtreecommitdiff
path: root/utils/deploy.sh
blob: bf2c69564b68da8585cd6e0ddd4d4b324d3e4ea0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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="--partial -v"
fi

/usr/bin/date +%s > "packages/LASTSYNC"
/usr/bin/rsync $ADDITIONAL_PARAM -r -c --update --links --delete --exclude=.gitignore "packages/" $1:/var/www/repo/