Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 38 lines (30 sloc) 711 Bytes
#!/usr/bin/env bash
#
# Publish the website in the given directory to the webhost using rsync, overwriting the
# destination to exactly match the local copy.
set -o errexit -o nounset -o pipefail
USER="$(<"${HOME}/.certs/webhost.username")"
declare -r USER
declare -r WEBSITE="${1:-}"
if [[ -z "${WEBSITE}" ]]; then
echo >&2 "Usage: $0 <website>"
exit 1
fi
echo >&2 "Publishing [${WEBSITE}]"
rsync \
--checksum \
--compress \
--delay-updates \
--delete \
--delete-after \
--force \
--human-readable \
--links \
--perms \
--progress \
--recursive \
--safe-links \
--stats \
"${WEBSITE}" \
"${USER}@${WEBSITE}:/home/${USER}"
echo >&2 "Done!"