Created
April 17, 2020 18:17
-
-
Save scottboms/f62286fe55e207addc1f6e0ad79f5db6 to your computer and use it in GitHub Desktop.
Simple rsync script to deploy a Kirby site over SSH with a non-standard port.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ERRORST="Whoops! Maybe check the command and try that again." | |
if [ $# -eq 0 ] | |
then | |
echo "$ERRORST"; | |
elif [[ "$1" == "help" ]] | |
then | |
echo "To run: update-site.sh deploy OR update-site.sh deploy go" | |
elif [[ "$1" == "deploy" ]] | |
then | |
if [[ -z $2 ]] | |
then | |
echo "Running deploy dry-run (no live changes)" | |
rsync --dry-run -az --force --delete --progress --exclude-from=rsync-excludes.txt -e "ssh -p 30000" ./ user@IP-ADDRESS:/path/on/server/ | |
elif [[ "$2" == "go" ]] | |
then | |
echo "Running deploy for reals" | |
rsync -az --force --delete --progress --exclude-from=rsync-excludes.txt -e "ssh -p 30000" ./ user@IP-ADDRESS:/path/on/server/ | |
else | |
echo "$ERRORST"; | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment